hash_map的问题 本帖最后由 znjcx 于 2009-09-12 16:36:11 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 printf("%d %d", (int)ite->second.UniqueProcess, (int)ite->second.UniqueThread); [code=C/C++]#include <hash_map>#include <stdio.h>using namespace std;using namespace stdext;int main(void){ hash_map<int, PORT_MESSAGE> hm; hash_map<int, PORT_MESSAGE>::const_iterator ite; PORT_MESSAGE ci; for (int i = 0, j = 100; i < 100; i++,j--) { memset(&ci, i, sizeof ci); hm[i] = ci; ite = hm.find(i); printf("%d %d", (int)ite->second.UniqueProcess, (int)ite->second.UniqueThread); } return 0;}//我这样写不行啊,编译不过,请指点code] 看错了,不好意思printf("%d %d", (int)ite->second.ClientId.UniqueProcess, (int)ite->second.ClientId.UniqueThread); 解决了,ite->second.ClientId.UniquePorcess这样就可以了,结贴 如何用tinyxml删除单个节点 实现移动所画矩形的功能,为什么不对? 大家谈谈,如果开个软件公司,做哪方面有前途呢 关于系统计时的问题 _RecordsetPtr m_pRecordset; ???? 哪位有像Windows2000任务管理器中性能的那个曲线图的源代码。 大侠们救命呐:如何画波形图 客户端丢包的问题 COM+有一种叫Library的Apllication.什么时候应该选择这种Application. win98和winnt中对于LPTSTR是不是不同? 夜深了,发一个双向指针链表,注释不多,有兴趣朋友可以看看. ?????怎样把控件设置成不能用
#include <hash_map>
#include <stdio.h>
using namespace std;
using namespace stdext;
int main(void)
{
hash_map<int, PORT_MESSAGE> hm;
hash_map<int, PORT_MESSAGE>::const_iterator ite;
PORT_MESSAGE ci;
for (int i = 0, j = 100; i < 100; i++,j--)
{
memset(&ci, i, sizeof ci);
hm[i] = ci;
ite = hm.find(i);
printf("%d %d", (int)ite->second.UniqueProcess, (int)ite->second.UniqueThread);
}
return 0;
}
//我这样写不行啊,编译不过,请指点
code]
printf("%d %d", (int)ite->second.ClientId.UniqueProcess, (int)ite->second.ClientId.UniqueThread);
这样就可以了,结贴