I have opened the file in "r+" mode and tried to use fputs
to replace old_line (line) with new_line (updated_line)
char updated_line[] = "Hello This was ABCD";
fseek(fp, -(strlen(line))-1, SEEK_CUR);
fputs(updated_line, fp);
Given txt file data :
Hello This is ABCD
Studying in XYZ College
Output:
Hello This was ABCD
udying in XYZ College
The two characters "St" are missing from next line. How do I rectify this ?