![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++全方位学习进度
文章平均质量分 79
xtayaitak
c++爱好者!
展开
-
static 静态变量和静态成员函数
<br />1.静态成员变量是属于整个类的全局变量,它不单属于某个对象。<br />2.静态成员变量必须在全局定议。<br />3.在使用静态成员变量时可以 不将其限定为某个具体的对象。原创 2010-09-10 01:04:00 · 266 阅读 · 0 评论 -
创建一个简单的string类
<br />#include <iostream> using namespace std; class String { public: String();//默认构造函数 String(const char*const ch);//带参数的构造函数 String(unsigned short int length); String(const String&rs); //利用复制构造函数赋值 ~String(); char&operato原创 2010-09-19 23:45:00 · 875 阅读 · 0 评论 -
多重映射
<br />#include <iostream> #include <map> #include <string> using namespace std; typedef multimap<string,string>::value_type CIT; typedef multimap<string,string>::const_iterator IT; template<class T1,class T2> void show(IT&it,multimap<T1,T2>&r) {原创 2010-10-27 00:08:00 · 782 阅读 · 0 评论 -
set的用法
<br />#include <iostream> #include <iterator> #include <set> #include <string> using namespace std; typedef set<string>::const_iterator CIT; template<class T> void show(CIT&it,set<T>&s) { for(it=s.begin();it!=s.end();++it) cout<<*it<<"/t"; c原创 2010-10-27 00:09:00 · 758 阅读 · 0 评论