View Single Post
Old Apr 30th, 2008, 4:19 PM   #4
peaceofpi
hi: for(;;) goto hi;
 
peaceofpi's Avatar
 
Join Date: Jun 2006
Posts: 87
Rep Power: 3 peaceofpi is on a distinguished road
Send a message via AIM to peaceofpi Send a message via MSN to peaceofpi
Re: multiple values for one char

Quote:
Originally Posted by ChevyCowboy15 View Post
is that right?
what would come next?
or is there a shorter way of doing this?
Something like this should do (obviously you'd have to modify it a bit for whatever you're doing)
c++ Syntax (Toggle Plain Text)
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int main() {
  5. string corrects[2] = { "Winston Churchill", "Churchill" };
  6. string input;
  7. getline(cin,input);
  8. if (input == corrects[0] || input == corrects[1])
  9. // do stuff
  10. return 0;
  11. }
__________________
How do you play Religious Roulette?
Stand around in a circle and blaspheme till someone gets struck by lightning.
peaceofpi is offline   Reply With Quote