I am trying to write a function that returns a struct
. I keep getting an error that says:
reference to overloaded function could not be resolved, Did you mean to call it?
Please help.
I am trying to write a function that returns a struct
. I keep getting an error that says:
reference to overloaded function could not be resolved, Did you mean to call it?
Please help.
cin >> endl
is a mistake. endl
is only for outputting.
To consume up to the end of the line after reading, you can use:
cin.ignore(numeric_limits<streamsize>::max(), '\n');
However for your program it is not necessary to do that. (Each >>
reader you use consumes leading whitespace already). So for this program you could just take out the >> endl
.
for 'cin', there is no overloaded operator to get 'string' datatype, but you can call getline(cin, employee.name) where getline is defined in