I was reading a book about C programming, and I came across this program example:
Ok, the author was obviously explaining getchar() and putchar() :PCode:#include <stdio.h> int main() { int c; c = getchar(); while (c != EOF) { putchar(c); c = getchar(); } }
The author said that the type of c must be int, because EOF needs to fit inside too, along with all the other characters (in range from -128 to 127).
My question is: What is EOF? What do I type to get out of the loop?