If I had a while loop that I wanted to stop only if the q key is pressed how would I do that.
However, I do NOT want it to quite the program
#define TRUE 1
#define FALSE 0
typedef int boolean;
int main(int argc,char* argv[]){
char *script = malloc(MAXPATH);
script = "ls";
boolean a;
a = TRUE;
while(a){ //this is the while loop i want to break incase of a keypress
system(script);
}
do something else
something else....
This will be running on Mac OS X.
both getchar() and getc() pause for a response which makes loop stop
native functions in C with which i can detect a keypress are :
you can use the above functions