>how do i verify that the expression getchar() !=EOF is zero or one?
If putchar ( c ); executes then the expression is one. You can say something like this, though that would be a bit silly:
Code:
int chk_bool = ( ( c = getchar() ) != EOF );
while ( chk_bool != 0 ) {
putchar ( c );
chk_bool = ( ( c = getchar() ) != EOF );
}
>how do i print the value of EOF?
Code:
#include <stdio.h>
int main ( void )
{
printf ( "%d\n", EOF );
return 0;
}
Though once again, there's little point in doing this.
-Prelude