Functions like fgets() and getch() will wait for the user to enter input before continuing. What I want is this functionality:
If the user presses ‘x’ a variable will begin decrementing, ‘c’ will cause the variable to begin incrementing.
The problem is the program halts when I try to get input. I want the variable to continue incrementing or decrementing and no ‘freezing’ while waiting for user input.
I am using visual studio 2008, writing a c console application.
Thanks!
You need a special CONSOLE INPUT/OUTPUT library like NCURSES or Borland’s CONIO to do that. Can’t do it with standard C library.
If you are using Windows exclusively, take a look at Windows Console Functions.