I'm trying to set this function up so that it waits for the user to press a key on the keypad and then returns the number that they pressed.
This is what I've got but it seems to be allowing anything to be returned.
int numpad(int min, int max) {
int input;
do {
input=getch() - 48;
}
while(input<=min && input>=max);
return input;
}
Anyone know what's going wrong here?