H.E.L.P. BEGINNER IN NEED. S.O.S

May 13, 2012 at 2:18pm
Okay, this is the prob. I can't seem to find out how to set up a a TEXT condition in C++, mac. this is the code snippet I plan to use: if (choicetext == yes), unfortunately, Xcode returns this error: Invalid operands to binary expression ('string' (aka 'basic_string<char>') and 'int'). I've got no heck idea how you are supposed to do that. Any suggestions??
May 13, 2012 at 2:28pm
The problem is that choicetext and yes are of different types. Change choicetext to int or change yes to string.
May 13, 2012 at 2:32pm
YES is a piece of text. I don't want it to be a variable. Example, I want to make YES the outcome of a if statement
May 13, 2012 at 2:34pm
Is this what you want? if (choicetext == "yes")
Topic archived. No new replies allowed.