Which of the following file stream function will not move the file pointer to (N+1)th record of a binary file F created with the help of objects of class…
Which of the following file stream function will not move the file pointer to (N+1)th record of a binary file F created with the help of objects of class EMPLOYEE ?
Show answerHide answer
Correct answer: (B) F. seekg (F.tellg( )*N);
Explanation
seekg(F.tellg()*N) multiplies the current position by N, which is not the offset of the (N+1)th record. The correct offset is N*sizeof(EMPLOYEE).