The user is asked whether he/she would like to continue with the program.
for some reason that code does not seem to work. Even if the user does not hit Y the program continues.Code:cin.ignore(); //ignores the previous input so it cannot interfere with this section of code if( kbhit() ) { //if the keyboard is hit KeyCode = getch(); //KeyCode(declared as an int) equals getchar if(KeyCode != 89) //if the GetChar is not 'Y' (or 89 in Decimal) EnteringData = false; // }
Oh yeah I almost forgot to mention you can look up the characters' decimal values at www.asciitable.com