对 this 指针的理解和做用

this指针只能在一个类的成员函数中调用,它表示的是当前对象的地址。函数 1. this只能在成员函数中使用。 全局函数,静态函数都不能使用this。 实际上,成员函数默认第一个参数为T* const register this。 如:  class Athis {spa public: 指针       int func(int p)对象       {}作用域 };原型 其中,func的原型在
相关文章
相关标签/搜索