Okay so I was just doing a little practice when I came to a problem that I've never had before.
#include <iostream>
using namespace std;
int main()
{
string empname = "";
int empage = 0;
char yes = 'y';
cout << "Please enter employee name:" << endl;
cin >> empname;
cin.get();
cout << "Your name is " + empname + " is this correct? (yes/no):" << endl;
if (yes)
{
cout << "good" << endl;
}
else
{
cout << "Please try again" << endl;
}
cout << "Please enter employee age:" << endl;
cin >> empage;
cin.get();
cout << "Your age is " + empname + " is this correct? (yes/no):" << endl;
if (yes)
{
cout << "good" << endl;
}
else
{
cout << "Please try again" << endl;
}
}
This executes as a console program, but after line 11 [include whitespace] (cout << "Please enter employee name:\t" << endl;), it just skips past everything, and says press ENTER to continue. What am I doing wrong.