View Single Post
Old May 1st, 2008, 3:30 PM   #13
Freaky Chris
Hobbyist Programmer
 
Freaky Chris's Avatar
 
Join Date: Dec 2007
Location: England
Posts: 169
Rep Power: 1 Freaky Chris is on a distinguished road
Send a message via MSN to Freaky Chris
Re: multiple values for one char

C++ Syntax (Toggle Plain Text)
  1. cout << "question?\n";
  2. getline(cin,answer1);
  3. for (int i=0; i < 5 ; i++){
  4. if (correct[i]==answer1)
  5. cout << "do something!!\n\n";
  6. else{
  7. cout << "do something!!\n\n";
  8. }
  9. }

it was just down to bracket placement, i think this will work im sort of busy at the same time so if theres a mistake just let me know. you had placed the else statement outside of the for loop.

Chris
__________________
Who said i couldn't program
sarcasm = raw_input('Type in a sarcastic remark: ')
print sarcasm
Freaky Chris is offline   Reply With Quote