When calling this function once, it works fine. But when you call it a second time it won't return the employee record correctly. I need to write a test harness that verifies the problem and be able to inspect the string name, and Employee object r after the second call.
#include <iostream>
#include <string>
using namespace std;
Employee read_employee()
{
cout << "Please enter the name: \n";
string name:
getline(cin, name);
cout << "Please enter the salary: \n";
double salary"
cin >> salary;
grind_coffee();
Employee r(name, salary);
system("Pause");
return r;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment