摘要:
一 this指针的使用 this指针,在成员函数中,一般指向调用该函数的对象的地址。 平时在直接访问类的数据成员的时候,一般是隐式地使用this指针来访问类的对象的。比如name=s,一般就是this->name=s。 可以使用*this来标识调用该成员函数的当前对象。 静态成员中不能访问this指 阅读全文
摘要:
一 首先以一个类的定义作为例子 在名称为student.h的头文件中 #include <iostream> using namespace std; #include <string.h> class Student { public: //外部接口 void input(char* pid,ch 阅读全文