简体   繁体   中英

is control-d a default stop sign for stdin? in linux C?

is control-d a default stop sign for stdin?

In our homework, it says command-d will be stop inputting.

Is it a default ?

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 eg feof(3) after some stdio operation, or compare the result of getc(3) with EOF (etc....) to detect end-of-file conditions!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM