#include <iostream>
#include <string>
#include <cstdlib>
usingnamespace std;
int main()
{
string answer;
cout <<"Welcome to Quiz Game\n\n\n\n";
cout <<"What is this game called?\n";
cin >> answer;
if (answer == "Quiz Game")
{
cout<<"That's correct!\n";
}
else
{
cout<<"That's incorrect!\n";
}
system("pause");
return 0;
}
My problem is that I can't get the correct answer because there is a space in "Quiz Game" whatever I write it goes to else instead of if.
It works when I don't have a space but what do I do to make it work with the space?