The latter, multiple employees in the same department. How would I use a vector inside of a map? I tried the following example but received an error C2665 'std::pair<_Ty1,_Ty2>::__ctor' : none of the 3 overloads can convert parameter 2 from type 'const char [5]' typedef map > EmployeeType; void MapVectorTest() { EmployeeType theMap; EmployeeType::iterator theIterator; theMap.insert(EmployeeType::value_type(0, "Zero")); // error C2665 }
-- modified at 14:43 Friday 2nd March, 2007 Thanks, Jason -- modified at 14:48 Friday 2nd March, 2007
The Bat Man
Posts
-
storage of employee objects in a container -
storage of employee objects in a containerBut what if there were multiple map key's (department number's) that are the same? It would only show the first occurance, right? Is there a way I can show all objects of that same key? Thanks, Jason
-
storage of employee objects in a containerI want to store a group of employee objects in an array or collection of some type and then be able to find which employees are of a certain department number. For example there may be a total of 10 employees with 4 of the employees belonging to department 1 and the rest to various other departments, I want to be able to find all of the employees belonging to department 1 and print those out. What do you think is the best way to do this? I tried to use a vector sequence container, but I don't know how I would find multiple employee objects depending on dept number attribute. Any help would be greatly appreciated, Jason