Help needed with a text-based game program
Here's the code, explanation of what's wrong at the moment at the bottom.
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main () {
string select;
cout << "Welcome to Link's Grand Quest!\n";
cout << "Select an option:" << endl << endl;
cout << "Create Character (press c)\n";
cout << "Load Character (press l)\n";
cout << "Creator (press r)\n";
cout << "Exit (press e)\n";
cin.ignore(80, '\n');
cin >> select;
if (select == "c" || select == "C") {
cout << "I'm sorry, this feature is not available yet";
}
else if (select == "l" || select == "L") {
cout << "I'm sorry, this feature is not available yet";
}
else if (select == "r" || select == "R") {
cout << "I'm sorry, this feature is not available yet";
}
else if (select == "e" || select == "E") {
}
else {
// while (select != "c" || select != "C" || select != "l" || select != "L" || select != "r" || select != "R" || select != "e" || select != "E") {
// cout << "I'm sorry, you did not select an option. Please select from below:\n\n";
// cout << "Create Character (press c)\n";
// cout << "Load Character (press l)\n";
// cout << "Creator (press r)\n";
// cout << "Exit (press e)\n";
// cin >> select;
// if (select == "c" || select == "C") {
// cout << "I'm sorry, this feature is not available yet";
// }
// else if (select == "l" || select == "L") {
// cout << "I'm sorry, this feature is not available yet";
// }
// else if (select == "r" || select == "R") {
// cout << "I'm sorry, this feature is not available yet";
// }
// else if (select == "e" || select == "E") {
// cout << "I'm sorry, this feature is not available yet";
// }
// else {
// }
// }
}
cin.get();
}
I commented out the parts I don't want running in the program for now, and the bug still exists, so I know the bug resides somewhere in the first cin >> select;'s area. When I type "c", it doesn't output a single thing, and you have to input something else (although enters don't seem to work) to get the program to close after that point. No matter what I use on cin >> select;, it does this. Any help?