What is the INKEY$ equivalent in C programming lan

2019-08-08 12:11发布

问题:

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