摘要: 1 #include 2 using namespace std; 3 4 class Good 5 { 6 public: 7 int member; 8 Good(int a): member(a) 9 {10 cout << "调用构造" << endl;11 cout << "member =" << member << endl;12 }13 void show()14 {15 cout << member << endl;16 }17 18 operator. 阅读全文
posted @ 2014-03-26 23:02 秋月的私语 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 4 class Good 5 { 6 public: 7 int member; 8 Good(int a): member(a) 9 {10 cout << "调用构造" << endl;11 cout << "member =" << member;12 }13 void show()14 {15 cout << member << endl;16 }17 Good operator+(const Go... 阅读全文
posted @ 2014-03-26 22:54 秋月的私语 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 4 class Good 5 { 6 public: 7 int member; 8 Good(int a): member(a) 9 {10 cout << "调用构造" << endl;11 }12 void show()13 {14 cout << member << endl;15 }16 Good operator+(const Good& obj)17 {18 return Good(m... 阅读全文
posted @ 2014-03-26 22:01 秋月的私语 阅读(214) 评论(0) 推荐(0) 编辑