Maps

W

Wilson

hi,

i know this is quite a basic question but could you please explain, as
simply as possible, the purpose of a map in c++ and how it is used,
thanks

wilson
 
A

Alf P. Steinbach

* Wilson:
i know this is quite a basic question but could you please explain, as
simply as possible, the purpose of a map in c++ and how it is used,

std::map is a templated container class.

It maps keys to values.

For example, (an instance of) std::map<std::string, int> maps strings to
integers, so it essentially provides a so-called "associative array".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top