C++ 如何将数据插入std::map并在vc6中显示std::map中的数据

C++ 如何将数据插入std::map并在vc6中显示std::map中的数据,c++,mfc,C++,Mfc,我用的是vc6。下面的代码有什么问题,我无法找出: std::map<int, std::vector<int> > myTemplate; //append data to map int temp=0; for (int i=0;i<=5;i++) { std::vector<int> tempVector; temp+=111; tempVector.push_back(temp); std::pair<i

我用的是vc6。下面的代码有什么问题,我无法找出:

std::map<int, std::vector<int> > myTemplate; 

//append data to map
int temp=0;
for (int i=0;i<=5;i++)
{
    std::vector<int> tempVector;
    temp+=111;
    tempVector.push_back(temp);
    std::pair<int, std::vector<int> > myPair;
    myPair=std::make_pair(i,tempVector);
    myTemplate.insert(myPair);
}

//show data from map
std::map<int, std::vector<int> >::iterator iter;
iter=myTemplate.begin();
while(iter!=myTemplate.end());
{
    std::vector<int> tempVector;
    std::vector<int>::iterator sencondIter=iter->second.begin();
    int myValue=*sencondIter;
    CString cstrTemp;
    cstrTemp.Format("%d is the int type value in vector<int>",myValue);
    AfxMessageBox(cstrTemp);

    iter++;
}
std::map myTemplate;
//将数据附加到地图
内部温度=0;
for(int i=0;isecond.begin();
int myValue=*sencondIter;
CString-cstrTemp;
格式(“%d是向量中的int类型值”,myValue);
AfxMessageBox(cstrTemp);
iter++;
}

之后加分号,而
会导致无限循环

while(iter!=myTemplate.end()); // <-----------------------

while(iter!=myTemplate.end());//我建议您在此处查看Microsoft Visual Studio Express:


对于MS VisualStudioIDs/P>的更新版本,不要使用Visual C++ 6。它不是标准的。甚至微软的标准也不包括微软Bob。这是真的,但它仍然是MS发布的最好IDE。所有版本都发布了。