if/else only giving else cout message

I'm very new to c++ and I was told by a lecturer to experiment with it at home, I'm using the if/else statement but no matter what is types i am getting the else cout message. any help as to where i've gone wrong with my coding?

1
2
3
4
5
6
7
8
9
10
11
 
		string answer_1;
		cin >> answer_1;
		if (answer_1 == "north ")
		{  cout << "You emerge at a cave " << endl;
			cout << "What will you do " <<endl;
		}
		else
		{
			cout << "You cannot do that please choose again.";
		}
Remove the space after the word north in your if statement.
You currently have:
if (answer_1 == "north ")
needs to become:
if (answer_1 == "north")
that seemed to work thank you so much!
Topic archived. No new replies allowed.