Search code examples
cscanfequivalent

What is the INKEY$ equivalent in C programming language


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.


Solution

  • On windows the easiest way is kbhit