Basicly I need the switch to recognize both 's' and 'S', incase user has capslock on, I've done it before but I'm just getting back to Programming and I can't remember how it was done.Code:clear_screen(); cout << "(S)tart a New Game\n"; cout << "(L)oad a Game\n"; cout << "(Q)uit\n"; choice=getch(); switch(choice) { case 's'||'S': NewGame(); break; default: cout << "You Must Pick 'S', Restarting"; main(); break; }
obviously doesn't work, do have to parse all the input into lower case? I thought there was a really simple way, but it's been 2 years.Code:case 's' || 'S':
Thanks in advance



LinkBack URL
About LinkBacks


