I m using getchar() fun. I want to give the EOF from the console
and then check it inside the prog wether its a EOF or not
how can I check it ....
what input shall i give
The mechanism for signaling EOF to a program is OS dependant.
On Unix systems it is usually by pressing control-D, but that
depends upon you not being in raw input mode, and depends upon
what your line discipline has set for eof, and often depends upon
whether you are at the beginning of a line or not (otherwise the
line discipline might treat control-D as a character deletion).
On DOS it would usually be control-Z instead of control-D, with
completely different line discipline rules.
To test for EOF in your program, be sure that you have #include'd
the proper headers, and then just compare the input character to EOF
But be careful -- getchar() returns a signed integer, not a char
and on many implementations, EOF is NOT representable as a char
(but is certain to be representable as a signed integer.)