"Kies Lee" <ll****@gmail.com> writes:
Hi everyone! I am a beginner in C. I knew the EOF is -1, but can anyone
tell me how can I type the EOF on the screen using the keyboard?
No EOF isn't necessarily -1; the standard merely says that it's a
negative value. (Most, possibly all, implementations use -1, but you
shouldn't depend on it.)
Keep in mind that end-of-file is a condition, not a character; the
value EOF is used to indicate that you've reached the end of the file.
How you cause and end-of-file condition varies from one system to
another. On Unix-like systems control-D is most common (once at the
beginning of a line, twice in the middle of a line). On DOS and
Windows systems, control-Z is most common.
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.