key press

I'm working on a program that requires the letter 't' to finish the program. How is that accomplished?
@PhillysCream


1
2
3
4
5
6
7
8
9
10
char input = ' ';
// etc.... program

while(input !='T')
{
   input = toupper(_getch()); // Waits for uppercase 'T' because keyword, toupper(), changes key
                              // press to upper case
}
// Program continues after a 'T' is entered to whatever you programmed to happen
 
Last edited on
Topic archived. No new replies allowed.