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

廉价感情. 提交于 2019-12-25 02:25:22

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!