#include <stdio.h>
main()
{
int c ;
while ((c = getchar()) != EOF)
{
int isEOF = (c==EOF);
printf("is %c EOF: %d ", c, isEOF);
}
}
Why printf() method is called twice on every input char here?
If i give a input 'a', I am getting the result like
E:\C_workouts>gcc CharIO.c -o CharIO.exe
E:\C_workouts>CharIO.exe
a
is a EOF: 0 is
EOF: 0
The same happens on every input.