In C++, which function can be used to test whether the end of a file (EOF) has been reached?
- checkEOF()
- testEnd()
- eof()
- isTerminated()
The eof() function is used to test if the end-of-file (EOF) has been reached on a file stream in C++. It returns true if the EOF flag for the stream is set. The other options are not standard functions for this purpose in C++.
Loading...
Related Quiz
- Which of the following scenarios is the most suitable for using a break statement in a professional codebase?
- Regarding memory alignment and data packing, which of the following is true for structs in C++?
- What is the minimum requirement for a recursive function to terminate successfully?
- Which of the following containers in the Standard Template Library (STL) allows duplicate elements and keeps them in sorted order?
- The bitwise NOT operator (~) performs a _______ operation on each bit of a number.