How can I do this to return all of John's info in an elegant way ? I come from a Java background and I really want to know how this is properly done in C++. That would also be cool if you can show me how to do this using a boost map (if it is easier that way). Thank you.
with what you have, its pretty much
myMap["John"] = myS; //you should use string, not char*, in c++. Char * is C code that c++ accepts but is only used if necessary.
then if you find on "John" (case sensitive!) it will give you back myS data.
a little smarter and more OOPish might be to make a class with a string name, int age, string city or whatever and stuff a string key and class as data into the map.
I am not aware that boost's maps are any better than c++. Boost tends to LEAD c++; its tools are frequently adopted into the language after being kicked around for a few years. Its probably pretty close, but I haven't studied this specific container.