Do hash variables exists in C++?

Now that I think about it this seems more of a beginner question but hey I'm here so whatever.

Any how in PERL there is something called has variables. This is basically an array but instead of index values, the contents of the array actually have names.

An example would be:

%zoo('primate' => "monkey" , 'reptile' => "alligator" , 'cat' => "loin");

So in instead of %zoo[1] = "alligator" you would say %zoo{'reptile'} = "alligator".

Is there anything similar to this in C++?
Look up std::map.
Check out enums:

http://www.cplusplus.com/doc/tutorial/other_data_types/



I also recommend reading through the documentation / reference section at the top left of this page.

Hope all goes well.
I'm not sure how enums relate to associative array types. In C++, the associative arrays are called 'map' and 'multimap'.
Topic archived. No new replies allowed.