Which of the following function calls will cause a file pointer to be returned to the beginning of the file?
fseek(0, SEEK_SET)
Correct:
fseek(0, SEEK_SET)
The correct answer is D. fseek() is used to move the pointer on an open file. The SEEK_SET constant is used to indicate that the offset provided with the function call should be taken to mean the number of bytes from the beginning of the file. SEEK_SET is also the default value used by fseek() if no starting offset is specified. Note that the rewind function is equivalent to fseek (0, SEEK_SET).