有如下类定义: class Pass{ static int count; public: Pass(){} void show()const; friend int getCount(); stat

admin2021-02-22  12

问题 有如下类定义:
    class Pass{
    static int count;
    public:
    Pass(){}
    void show()const;
    friend int getCount();
    static int iilere();
    };
    在所声明的4个函数中,具有this指针的有(    )。

选项 A、Pass和show
B、Pass和getCount
C、show和incre
D、getCount和incre

答案A

解析 C++的类定义中,只有非静态成员函数具有this指针,Pass类中getCount()函数是友元函数,不属于成员函数,没有this指针,选项B、D错误;incre()函数是静态成员函数,没有this指针,选项C错误;答案为A。
转载请注明原文地址:https://kaotiyun.com/show/Snfp777K
0

最新回复(0)