Since the key is char* , they will be compared by address, and not by value, for example.
char* a = "123"; char* b = new char[4]; memcpy(b, a, 4); assert(a != b);
You should use std::string , which has an overloaded < for comparison by value.
typedef std::map<std::string, Person*> mapType; ...
(You probably want to use Person or shared_ptr<Person> as a value to avoid memory leaks.)
source share