the simple program below increments numbers until a key on the keyboard is hit. I want the program to increment numbers while a key is pressed down by the user and to stop incrementing the numbers when the key (being the space bar) is no longer pressed down. please can someone help me out as im not sure how thats done.....thanks
Code:
#include <conio.h>
#include <stdio.h>
int main (void)
{
int sale;
sale = 000.00;
do{
clrscr();
printf("%d", sale);
delay(150);
sale += 0.01;
}while(!kbhit());
return 0;
}