The main problem is with calling getReportedEmployees() function. On CodeBlocks I am getting an empty list on calling this function. How to resolve this ?
unordered_map<int, Employee*> storeData(Employee *emp, int parseInt)
{
data.insert ( std::pair<int,Employee*>(parseInt,emp) );
Employee *empl; //unitialised
if(data.find(emp->getManagerId()) != data.end()) //¿what if this fails?
empl = data.find(emp->getManagerId())->second;
if(empl->getId()!=emp->getId()) //empl would be invalid
empl->getReportedEmployees().push_back(emp);
return data;
}
you are inserting the pair {parseInt, emp} but searching for the key 'emp->getManagerId()'
You never set the `manager_id' for `emp10'
(check out about constructors)