map表find方法的怪异问题
代码如下:
void CMyApp::Test(char *t){ vpObject *po=new vpObject(); g_pHPObjManager[t]=po; Test1();}void CMyApp::Test1(){ CString str; map<char *,vpObject *>::const_iterator i; map<char *,vpObject *>::iterator j; for(i=g_pHPObjManager.begin();i!=g_pHPObjManager.end();i++) { str.Format("%s",i->first); //str="ee" j=g_pHPObjManager.find("ee"); //"ee"为Test传入的参数 str.Format("%s",j->first); //程序崩溃????!!!!! }}
void CMyApp::Test(char *t){ vpObject *po=new vpObject(); g_pHPObjManager["ee"]=po; Test1();}