#include <iostream> #include <vector> #include <map> using namespace std; struct LevelAwardItems { int m_ItemID; int m_Num; int m_KeyWorld; }; typedef vector<LevelAwardItems> templateItem; templateItem m_VectItem; map <int, templateItem>m_MapLevelAward; void main() { for(int j=0;j<2;j++) { for(int i=0;i<2;i++) { LevelAwardItems item; item.m_ItemID = i; item.m_Num = i; item.m_KeyWorld = i; m_VectItem.push_back(item); } m_MapLevelAward[j] = m_VectItem; m_VectItem.clear(); } for(int j = 0;j<2;j++) { m_VectItem = m_MapLevelAward[j]; int nItemCout = m_VectItem.size(); for(int k = 0;k <nItemCout;k++) { LevelAwardItems item; item = m_VectItem[k]; cout<<item.m_ItemID<<endl; cout<<item.m_Num<<endl; cout<<item.m_KeyWorld<<endl; } } getchar(); }