C++ map容器的2种初始化方法

#include 
#include 
#include 
using namespace std;


int main()
{
	 map map1;
	 map1[string("tttt")] = 1;
	 map1[string("ggg")] = 2;
	 map1.insert(pair("niubi", 3));
	 map::iterator it = map1.begin();
	 while ( it != map1.end())
	 {
	  
		 cout<first<<" "<second<


你可能感兴趣的:(c/c++,语法规则/对象模型)