I\'m trying to find a way to replace a line, containing a string, in a file with a new line.
If the string is not present in the file, then append it to the file.
To replace the last two lines in your file:
fopen()
to open the filefgetpos()
fseek()
fprintf()
your new lines to the file and close it with fclose()
afterwards.