I'm beginning c++, and I want to do if statements with strings, but how.
#include <iostream>
using namespace std;
int main()
{
int a;
cout << "Do you like the food?"<< endl;
cin>> a;
if (a == "yes"){
cout<<"Thank you!"<<endl;
}
if (a == "no"){
cout << "That's mean!"<<endl;
}
return 0;
}
What do you think I should do? I like experimenting when learning a new programming language, but most of the time I can figure out how to do what I want to do, but my streak is up and I now need help. So, how do I do this properly? I think I should be able to do this as with some of the ideas I have involve more things like this, so please help me out here.
Thanks in advance!!!