Is it possible for C to test and see if the "*", "+", "-", and the "/" key are pressed (just the math functions). And if it is how could you go about doing it?
Is it possible for C to test and see if the "*", "+", "-", and the "/" key are pressed (just the math functions). And if it is how could you go about doing it?
If you mean at the console, read in character press into an int variable, and then do a test.
If you mean asynchronously whenever the keys are pressed, then you gotta do it differently.Code:int c; .... c = getchar(); if(c == '*') { /* '*' was pressed. */ }
Nvm I am a moron.. I just figured it out...
Ya, that is what I did.. thanks anyway :-)