Reputation: 41
#include <stdio.h>
int main()
{
char c = getchar(); //EOF (ctrl + d )
while( ( c = getchar() ) != '?' )
{
printf( "%d\n", c == EOF );//infinite loop printing 1
}
}
What happens here?
It is as if EOF completely blocks reading anything after it?
Upvotes: 3
Views: 89