Well for starters, you don't really need the function that you made there, since this seems to be a fairly simple operation. To make a program with choices you'd do something like this:
Code:
#include <iostream>
using namespace std;
int main() {
int userInput;
cout << "How are you?" << endl
<< "1. Good" << endl
<< "2. Fine" << endl
<< "3. Bad" << endl
<< "> ";
cin >> userInput;
if (userInput == 1) {
cout << "\"I'm Good, thank you.\"" << endl;
}
else if (userInput == 2) {
cout << "\"I'm fine.\"" << endl;
}
else if (userInput == 3) {
cout << "\"I'm feeling bad, sorry.\"" << endl;
}
else {
cout << "\"I'm not sure how I'm feeling.\"" << endl;
}
system("pause");
return 0;
}
I'd read more of the tutorials. Read up on Input and if statements. There is no way the book you have doesn't cover those if it is indeed a basic C++ book.
...and the second + in C++ essentially means 1. In C++, if you write a variable++ you're saying "variable = variable + 1". So C++ is basially saying it's like the language "C" plus 1.