EOF
is not a character, it's more like a signal (not the Unix signal) indicating End-of-File. Is value is implementation dependent, but guaranteed to be unequal to any valid character, usually -1
.
When you use putchar(EOF)
, or putchar(-1)
, it's converted to unsigned char
, 255
. But the ASCII value 255
isn't a printable character, the result varies in different machines.