2020年3月14日
摘要: #include <iostream> using namespace std; class Point { public: Point(int x = 0, int y = 0) : x(x), y(y) { count++; } Point(const Point &p) : x(p.x), y 阅读全文
posted @ 2020-03-14 18:17 ~明月几时有 阅读(404) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; class Base1 { public: Base1(int i) { cout << "Constructing Base1 " << i << endl; } ~Base1() { cout << "Destru 阅读全文
posted @ 2020-03-14 18:14 ~明月几时有 阅读(431) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; class Base0 { public: int var0; void fun0() { cout << "Member of Base0" << endl; } }; class Base1: virtual pu 阅读全文
posted @ 2020-03-14 18:12 ~明月几时有 阅读(79) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; class Point{ public: Point(int x=0,int y=0):x(x),y(y){count++;} Point(const Point &p):x(p.x),y(p.y){count++;} 阅读全文
posted @ 2020-03-14 18:06 ~明月几时有 阅读(160) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; class A { public: A(int i); void print(); private: const int a; static const int b; }; //静态常数据成员在类外说明和初始化 con 阅读全文
posted @ 2020-03-14 18:03 ~明月几时有 阅读(947) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; class Point { public: Point() : x(0), y(0) { cout<<"Default Constructor called"<<endl; } Point(int x, int y) 阅读全文
posted @ 2020-03-14 17:59 ~明月几时有 阅读(684) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; class Date; class Time{ public: Time(int, int, int); void display(const Date&); private: int hour,minute,secon 阅读全文
posted @ 2020-03-14 17:20 ~明月几时有 阅读(212) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; class Point{ public: Point(float=0,float=0); void setPoint(float,float); float getX()const{return x;} float ge 阅读全文
posted @ 2020-03-14 09:58 ~明月几时有 阅读(607) 评论(0) 推荐(0)