Question 7
Back to Exercise
What does fseek(fp, -3L, SEEK_END); do?
- A Moves 3 bytes past the end
- B Moves the position to 3 bytes before the end of the file Correct
- C Moves back 3 bytes from the current position
- D It is invalid: offsets cannot be negative
Correct Answer: Option B
The offset is added to the origin. With SEEK_END the origin is the end of the file, so a negative offset moves backwards from it. Use SEEK_CUR for a move relative to the current position.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!