Question about data container 'map'

Oct 17, 2014 at 3:55pm
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
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.