I need a way to open an existing file, adding some text in the end, rewind the file to where I opened it, and replace the text with another one.
if the text file looks like:
I want to open it, and add:
and then (in the same iteration), rewind the file and replace the "cc" with "dd" :
I've tried to use fseek, but it doesn't seems to work with fopen (....,"a+") function. I've also tried to print backspace, but that didn't work either.
Any help would be appreciated.