map

Hi.
What are 'first' and 'second' in the example at:
http://www.cplusplus.com/reference/map/map/at/

?(The last line)

Thanks in advance
closed account (10X9216C)
That for statement is using the ranged based for statement which uses the begin/end of the variable.

http://www.cplusplus.com/reference/map/map/begin/

It returns a "value_type" which you can see here is just a pair<> of the key_type and mapped_type: http://www.cplusplus.com/reference/map/map/#types
Last edited on
first and second are the items in the map.

so in the example.. { "alpha", 0 }

first=="alpha" second==0
Topic archived. No new replies allowed.