how to reset pointer to top of file c++ code example
Example 1: reset the reading position to beginning in c
rewind(fptr);
Example 2: reset the reading position to beginning in c
fseek(fptr, 0, SEEK_SET);
rewind(fptr);
fseek(fptr, 0, SEEK_SET);