摘要: this指针 作用:指向成员函数所作用的对象 #include <iostream> #include <algorithm> #include <cstring> using namespace std; class Complex { public: double real, imag; voi 阅读全文
posted @ 2022-12-29 18:07 cxy8 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 成员函数和类的定义分开写 class Crectangle { public: int w, h; int Area(); int Perimeter(); void Init(int w_, int h_); } int CRectangle::Area() { return W * h; } i 阅读全文
posted @ 2022-12-29 16:43 cxy8 阅读(29) 评论(0) 推荐(0) 编辑