I have this code:-
FILE * fp;
fp = fopen ( "file.txt" , "w" );
fputs( "Here is a load of writing that I have just writen
", fp );
fseek ( fp , 11 , SEEK_SET );
fclose ( fp );
The code moves along till the 11th character in the file, and inserts the character '#'
When I run this code I get this:-
~]$ cat file.txt
Here is a l#ad of writing that I have just writen
However, instead of over writing the 'o' in "load" I want it to insert it, like this:-
"Here is a l#oad of writing that I have just writen"
Is there a way of doing this besides storing everything past the 11th character in memory, inserting the # then writing the rest of the content back to the file?