EOF 和 Enter键 在cmd中的实现

EOF即:end of file.代表文档的结束,在cmd中若是要手动结束,则换行输入ctrl+Z即可。
此外要想通过Enter键结束循环或程序,可通过 ‘\n’ 和 10(Enter的ANSI)来实现。
比如以下通过点击Enter键来结束循环:
while (c != ‘\n’)或者while (c != 10)

猜你喜欢

转载自blog.csdn.net/weixin_43641971/article/details/88120049