有如下头文件: int f1(); static int f2(); class:MA{ public: int f3(); static int f4(); }; 在所描述的函数中,具有

admin2020-07-23  17

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

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

答案C

解析 只有类的非静态成员函数才隐含this指针,其作用域是类内部,当类的非静态成员函数中访问类的非静态成员时,编译器会自动将对象本身的地址作为一个隐含参数传递给函数,而不必一定写上this。所以本题答案为C。
转载请注明原文地址:https://kaotiyun.com/show/4Qyp777K
0

最新回复(0)