Multiple choice

The statement fseek(fp,0L,0) means

  1. fp is a file pointer

  2. position the read-write-head at the start of the file

  3. position the read-write-head at the end of the file

  4. erase the contents of the file

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In standard C I/O library, fseek(fp, offset, whence) is used to move the file position indicator. Passing 0L as the offset and 0 (SEEK_SET) as the whence argument positions the read-write head at the beginning of the file.