How to correctly use the if/else statement when working with strings

When i use the if statement while working with strings, i always get the first option presented, as if it doesnt actually do the test just runs the first so heres my script

string enter;
cin >> enter;
if (enter=="yes" || "Yes")
{cout << "The objective is to collect gold!" << endl;}
else{cout << "Okay, goodbye!" << endl; return 1;};

all i ever get is "The objective is to collect gold!" thanks for your time, really appreciate it
You need to do if(enter == "Yes" || enter == "yes")

You can't check both at the same time like you are doing.
Okay thanks that worked, also do you know how to use something other than 'if' so that if you misspell it, it doesnt just quit the program?
Topic archived. No new replies allowed.