int f1();
class T
{
public:static int f2();
private:friend int f3();
protect:int f4();
};
f4()
this指针只能在类的成员函数中使用,它指向该成员函数被调用的对象。
静态成员函数没有this指针。
友元函数是非成员函数,没有this指针。
static类对象必须要在类外进行初始化
只有类的非静态成员才有this指针,static显然没有,友元函数也没有
int f1();
class T
{
public:static int f2();
private:friend int f3();
protect:int f4();
};
f4()
this指针只能在类的成员函数中使用,它指向该成员函数被调用的对象。
静态成员函数没有this指针。
友元函数是非成员函数,没有this指针。
static类对象必须要在类外进行初始化
只有类的非静态成员才有this指针,static显然没有,友元函数也没有