What is the INKEY$ equivalent in C programming language

[亡魂溺海] 提交于 2019-12-11 05:39:54

问题


I am a beginner in C programming language but I have knowledge of programming in QBasic. I make lots of small programs in Qbasic to solve my basic tasks and I am recently rewriting those programs into C .

While rewriting one of the programs I stumbled upon a problem where the computer would be able to get input but without pausing the program execution. Unfortunately, scanf would cause the program to wait until the user presses any key and presses enter but I need my program run and still be able to get input.


回答1:


On windows the easiest way is kbhit



来源:https://stackoverflow.com/questions/8279802/what-is-the-inkey-equivalent-in-c-programming-language

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