E
Ed Morton
Ctrl-c works just fine.
Typing Ctrl-D is usually, but not always, how to provide an EOF. Typing that
when manually entering input is just like if you ran your program redirecting
input from a text file instead of typing it you'd get an EOF at the end of the
input stream. Typing Ctrl-C (or "Ctrl-?" or "Del" or whatever your interrupt
keystroke happens to be) interrupts the running process just like it would if
that process were exeucting a shell script instead of a C program.
But absolutely nothing was said about this
in K&R or the FAQ.
Well, no, it wouldn't be. It isn't a C issue, it's a UNIX one, and it's a
question that I've never seen asked before in this NG so it wouldn't qualify as
"Frequently Asked". It is, however, addressed in the ksh manual page:
eof End-of-file character, normally ^D, is processed
as an End-of-file.....
Regards,
Ed.