Which of the following file stream function will move the file pointer to Nth record in a binary file F created with the help of objects of class EMP?
Show answerHide answer
Correct answer: (C) F.seekp((N−1)* sizeof(EMP))
Explanation
Records are stored one after another, so the Nth record begins after N−1 records, at byte offset (N−1)*sizeof(EMP). seekp() moves the put pointer there; tellg() only reports the current position.