摘要: #include <iostream>#include <string.h>#include <stdio.h>#include <map>using namespace std;class MapTemplate{public:typedef map <int ,string> templatemap;templatemap testmap;templatemap::iterator Find(int nID){return testmap.find(nID);}string GetElement(int nID){template 阅读全文
posted @ 2011-10-18 17:59 byfei 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Map是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据处理能力,由于这个特性 map内部的实现自建一颗红黑树(一种非严格意义上的平衡二叉树),这颗树具有对数据自动排序的功能。... 阅读全文
posted @ 2011-10-18 17:35 byfei 阅读(46) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <string.h>#include <stdio.h>#include <map>using namespace std;typedef map <int ,string> templatemap;templatemap testmap;templatemap::iterator Find(int nID){return testmap.find(nID);}string GetElement(int nID){templatemap::iterator iter = Find 阅读全文
posted @ 2011-10-18 17:34 byfei 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 例子: string s, ss; . s = "The rain in Spain falls mainly in the plain."; ss = s.substr(12, 5); //Spain s.substr(12) //Spain falls mainly in the plain. 阅读全文
posted @ 2011-10-18 10:44 byfei 阅读(187) 评论(0) 推荐(0) 编辑