Why can't you just use the = operator?
//Accessor Function to read integer input into age variable
int& Person::read_age(int& a)
{
a = age;
return a;
}
WolfPack
Postaholic
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
I think the problem is that you have declared iter as const_iterator.
map<string, Person>::const_iterator iter;
Change it to
map<string, Person>::iterator iter;
WolfPack
Postaholic
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115