【发布时间】:2012-11-21 00:40:33
【问题描述】:
可能重复:
C/C++: Capture characters from standard input without waiting for enter to be pressed
我在 Windows 7 上使用 C-Free 4 Standard 并且正在编写一个 C 程序。
我使用 getch() 作为暂停程序的函数,但是,按下的字符会在屏幕上回显,它会等待按下 Enter 键,然后再继续(它看起来没有任何不同于 scanf 的工作方式)。我尝试了getche(),它工作正常,虽然出现了回声。
getch() 函数可能有什么问题?
【问题讨论】: