Which of these values is returned by read() method is end of file (EOF) is encountered?

Which of these values is returned by read() method is end of file (EOF) is encountered?
A. 0
B. 1
C. -1
D. Null
 
Answer: c
Explanation: Each time read() is called, it reads a single byte from the file and returns the byte as an integer value. read() returns -1 when the end of the file is encountered.
 

Tìm kiếm

Back
Top