i have a code that you enter section after section. when your done, you type end, and it stops asking you to enter in stuff. My problem is, I can get it to detect when I type end.
here is my problem:
cout << "\n\n\nTo start, enter each section line per line, by entering a section, hitting enter, then the next section, enter, and so on. when you done, type end.";
cin >> stringa;
end = stringc;
if (end = end)
{
cout<< "ok, you are now finished entering #'s\n\n";
}
else
{
cout << "\nNext:\n";
cin >> stringb;
end = stringc;
if (end = end)
{
cout<< "ok, you are now finished entering #'s\n\n";
}
else
{
cout << "\nNext:\n";
cin >> stringc;
end = stringc;
if (end = end)
{
cout<< "ok, you are now finished entering #'s\n\n";
}
else
{
cout << "\nNext:\n";
cin >> stringd;
}
I see the problem here. it's saying that if the string "end" equals itself, then go into the if statement. but what I want to happen is if someone actually types end, and hits enter, I want it to be able to know. if they type anything else, then just keep going. how do i do that?