how to print EOF in C programming??
Here is a program i have found to print the eof .but when it is compiled , its showing following errors:
In function âmainâ: eof.c:5: warning: incompatible implicit declaration of built-in function âprintfâ eof.c:6: error: âEOFâ undeclared (first use in this function) eof.c:6: error: (Each undeclared identifier is reported only once eof.c:6: error: for each function it appears in.) Code:
|
Hi.
Change Code:
#inlude <stdio.h> Code:
#include <stdio.h> |
Typographical errors notwithstanding, EOF is not a character, but rather a state. It isn't intended to be printed.
--- rod. |
EOF is a CTRL-D in the input stream. Hence typing this keystroke will result in a return code of 0 being printed as gethchar will return a -1 then (which needs to be checked for being EOF or an error).
|
All times are GMT -5. The time now is 01:09 AM. |