Possible Duplicate:
Why doesn't getchar() recognise return as EOF in windows console?
I'm new in C and trying to figure out how EOF and getChar() works.
#include <stdio.h>
main()
{
int number = 0;
while(getchar() != EOF)
number++;
printf("%d", number);
}
When I type some random characters, the program doesn't do anything, I think that it never gets out of that while loop. Why is that? I'm using CodeBlocks on Windows 7.