that did work but now it goes to that and doesn't allow the loop to continue if the
cout << "Do you want to do this?: Y/N " << endl; equals = Y
I want the loop to continue if Y, to go to "sorry no good" if !=Y && !=N
and "see you later" if N.
Make sense?
That's where I'm having the issues
Your brackets are wrong, it should be:
1 2 3 4 5 6 7 8
|
if(doThis == 'Y')//one statement, no brackets
continue;
else if (doThis != 'Y' && doThis != 'N')//one statement, no brackets
cout << "Sorry no good" << endl;
else if (doThis == 'N' ){//two statements, use brackets!!
cout << "later" << endl;
break;
}
| |
Some people even use brackets for one statement, because it saves them work later on when they add more.
Last edited on