#include #include #include using namespace std; int main() { pair pa[] = { pair("one", 10), pair("two", 20), pair("three", 30), }; map object(&pa[0], &pa[3]); for ( map::iterator it = object.begin(); it != object.end(); ++it ) cout << setw(5) << it->first.c_str() << setw(5) << it->second << '\n'; } /* Generated output: one 10 three 30 two 20 */