EOF is defined in stdio.h and you should not assume it to be of any particular value.
a program used to show how to catch EOF from stdin:
(from C Primer Plus)
int main(void) {
int ch;
while((ch = getchar()) != EOF)
putchar(ch);
}
It uses an int to contain the value of EOF because the binary representation of EOF can be out of the range of 0x00~0xFF, such as 0x025c.
If you use a char to catch a EOF, all you can get is 0x5c, printed as character '\\'