Logo

Programming-Idioms

History of Idiom 8 > diff from v6 to v7

Edit summary for version 7 by :

Version 6

2015-08-20, 18:33:00

Version 7

2015-08-21, 23:03:12

Idiom #8 Initialize a new Map (associative array)

Declare a new map object x, and provide some (key, value) pairs as initial content.

Idiom #8 Initialize a new Map (associative array)

Declare a new map object x, and provide some (key, value) pairs as initial content.

Imports
#include <map>
Imports
#include <map>
Code
std::map<const char*, int> x;
x["one"] = 1;
x["two"] = 2;
Code
std::map<const char*, int> x;
x["one"] = 1;
x["two"] = 2;
Doc URL
http://www.cplusplus.com/reference/map/map/
Origin
http://www.cplusplus.com/reference/map/map/