有如下头文件: int f1(); static int f2(); class MA{ public: int f3(); static int f4(); friend int f1(); friend stat

admin2021-02-22  20

问题 有如下头文件:
int f1();
static int f2();
class MA{
public:
     int f3();
     static int f4();
     friend int f1();
     friend static int f2();
};
在所描述的函数中,具有隐含的this指针的是

选项 A、f1
B、f2
C、f3
D、f4

答案C

解析 类的非静态成员函数都隐含this指针,静态成员是类的组成部分,不是任何对象的组成部分,因此静态成员函数没有this指针,选项D错误;友元函数不属于成员函数,没有this指针,选项A、B错误;答案为C。
转载请注明原文地址:https://kaotiyun.com/show/67yp777K
0

相关试题推荐
最新回复(0)