摘要: 例一: 1 #include<iostream> 2 using namespace std; 3 class numbered{ 4 private: 5 static int seq; 6 public: 7 numbered(){ mysn = seq++;} 8 int mysn; 9 }; 阅读全文
posted @ 2020-07-10 16:17 wsl96 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 一. 拷贝构造函数 1 #include<iostream> 2 using namespace std; 3 class CExample 4 { 5 private: 6 int a; 7 public: 8 //构造函数 9 CExample(int b) 10 { 11 a=b; 12 pr 阅读全文
posted @ 2020-07-10 11:11 wsl96 阅读(1049) 评论(0) 推荐(1) 编辑