I have this (I've just started to learn btw):
#include <iostream> #include <string> using namespace std; int main() { string mystr; cout << "Welcome, what is your name? "; getline(cin, mystr); cout << "Nice to meet you, " << mystr << endl; cout << "May i call you 1 for short? (y/n)" << endl; getline(cin, mystr); } I want to next say;
cout << "Thank you, 1" << endl; OR:
cout << "Well ok, " << mystr << endl; ... based on whether or not the user has typed y or n. How would i go about this? I've had a look around but i don't really know how to word it. I'm using Visual Studio Express and it is a console application.
ifstatement?