In my C programming book, if I do not input a real char, the statement getchar() != EOF will return 0. But when I practiced this principle, I found it did not make sense according to my result. My code always return 1 no matter what character I give. Is there anything wrong with my code?
Here is it:
#include <stdio.h>
main()
{
printf("%d\n", getchar() != EOF);
}