Possible Duplicate:
EndOfFile in C - EOF
I was trying examples from K&R. I am not able to understand why this code does not exit unless ctrl+c
is pressed.
int main ( )
{
int c;
c = getchar();
while(c!=EOF)
{
putchar(c);
c=getchar();
}
}
Any help is appreciated. Thanks!
EDIT: Using Windows (Visual Studio 2010)