现在的位置: 首页 > 综合 > 正文

C++ map在MFC中的应用

2013年07月22日 ⁄ 综合 ⁄ 共 238字 ⁄ 字号 评论关闭

class CAgent
{
public:
 CAgent();
 virtual ~CAgent();
};

注:CAgent不可继承MFC类

*.h文件中

#include <map>
#include <string>
using namespace std;
#include "Agent.h"

*.cpp 文件中

map<string,CAgent> AgentList;

string s="1001";
CAgent agent1;
AgentList.insert(make_pair(s,agent1));

抱歉!评论已关闭.