Multiple choice

Which statement takes the file pointer to the beginning of the file?

  1. filepointer.seekg(0L,ios::start);

  2. filepointer.seekg(1L,ios::beg);

  3. filepointer.seekg(0L,ios::beg);

  4. filepointer.seekg(0L,io::beg);

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

The function seekg() is used to position the file pointer at a specific place. So, the statement filepointer.seekg(0L,ios::beg); positions the file pointer at the beginning of the file.