问题
is control-d a default stop sign for stdin?
In our homework, it says command-d will be stop inputting.
Is it a default ?
回答1:
Ctrl-D on Linux terminal with default settings is an end-of-file marker for stdin.
See also the tty demystified and the stty(1) command (and termios(3)...). Use e.g. feof(3) after some stdio operation, or compare the result of getc(3) with EOF (etc....) to detect end-of-file conditions!
来源:https://stackoverflow.com/questions/24548087/is-control-d-a-default-stop-sign-for-stdin-in-linux-c