this 指针

#include<iostream>
using namespace std;
class A
{
private:
    int a;
    int b;
public:
    A(int a,int b)//==A(A *this,int a,int b);
    {
        this->a = a;
        this->b = b;
    }
};
int main()
{
A a1(2,3);
}
A(A *this,int a,int b);其中构造函数中的第一个参数为指向该类对象的一个指针;
2、这个指针载类中通常是隐藏的;
3、除了静态成员函数,其他函数均有一个this指针。因为静态成员函数是属于类的;而不属于对象;
原文地址:https://www.cnblogs.com/defen/p/5312176.html