Multiple choice general knowledge science & technology

What is the Value of EOF in C++ ?

  1. 0

  2. -1

  3. 1

  4. void

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

EOF is a macro constant defined as -1 in C/C++ to signal end-of-file or read errors. Functions like getchar() return EOF when they can't read more data. Zero typically indicates success, positive values are valid character codes, and void is a type not a value.