whats the deal with EOF really ???
I have been trying to understand the EOF flag marker and have been unable to really figure out whats going on inside. This is a program from "K&R The C Programming Language, 2nd Edition"
while ((c = getchar()) != EOF)
1. Whats the deal with author using c as an integer, "his explantion was that he needs enough space to display any type of value returned by getchar()", which I don't understand, will a "char c" also not do the exact same thing :confused: :confused: ???
2. Whats the real deal with EOF because the above program displays the value at the first entry of "\n" so is newline regarded as the end of file marker, but the program never ends ???
3. What values does EOF return during its working cycle and what value does it return when the flag is set ???
("I tried to print the EOF value and I kept getting -1 !!!" )