cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Question about data container 'map'
Question about data container 'map'
Oct 17, 2014 at 3:55pm UTC
Nebur
(68)
Don't you need to set the size of the map?
I saw a code where typing m[k] would create the element whose key was k and at the same time access it, how is this possible?
Oct 17, 2014 at 3:58pm UTC
Disch
(13742)
Map's [] operator will actually create an element with that key if it does not already exist. This is a little weird since other containers don't work that way.
Topic archived. No new replies allowed.