Points to Note:
void rewind(FILE *stream) - Sets the file position to the beginning of the file of the given stream.
void fseek(FILE *stream, long int offset, int whence) - Sets the file position of the stream to the given offset.. ( More informally , it moves the file position to particular offset from the whence. )
whence is nothing but the starting point, it can take values SEEK_SET - Beginning of the file,
SEEK_CUR - Current position of the file, SEEK_END - End of the file
struct student s;
printf("Enter the no of students..");
printf("\nEnter the roll no and the name of each student one by one..");
// Writing to a file...
// Reading from a file...
// Modifying a file...
printf("\nEnter the roll no of the student to be modified..");
printf("\nEnter the new name of the student..");
// Reading a modified file...
printf("\nThe modified file is...\n");
Corner Case :
Sorry for the inconvenience, this program allows you to modify the existing student name with a new student name only with same length.. I'll try handle this case in my future posts..