How can you position the file pointer to the end of a file using fseek?
- fseek(file, SEEK_END)
- fseek(file, FILE_END)
- setpos(file, END)
- setfilepos(file, SEEK_END)
The correct option is fseek(file, SEEK_END). This command uses the fseek function to move the file pointer to the end of the file, facilitating operations like appending data to the end of a file in C.
Loading...
Related Quiz
- How is the size of a union determined in C?
- In C, a string is essentially an array of ________ terminated by a null character.
- What is the role of the 'continue' statement in a loop?
- What does the fseek function do in a C program?
- The function ________ can be unsafe to use as it does not check for buffer overflow while reading a string in C.