2

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!

Mike
  • 1,760
  • 2
  • 18
  • 33
Liver
  • 363
  • 1
  • 3
  • 19

1 Answers1

3

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.

Pablo Santa Cruz
  • 176,835
  • 32
  • 241
  • 292