首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下类定义: class Pass{ static int count; public: Pass(){} void show()const; friend in
有如下类定义: class Pass{ static int count; public: Pass(){} void show()const; friend in
admin
2015-07-22
18
问题
有如下类定义:
class Pass{
static int count;
public:
Pass(){}
void show()const;
friend int getCount();
static int incre();
};
在所声明的 4 个函数中,具有 this 指针的有
选项
A、Pass 和 show
B、Pass 和 show
C、show 和 incre
D、getCount 和 incre
答案
A
解析
C++的类定义中,只有非静态成员函数具有this指针,Pass类中getCount()函数是友元函数,不属于成员函数,没有this指针,选项B、D错误;incre()函数是静态成员函数,没有this指针,选项C错误;答案为A。
转载请注明原文地址:https://kaotiyun.com/show/kMNp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有以下程序:#include<iostream>usingnamespacestd;intf(int,int);intmain(){inti:1,x;x=f(i,i+1);
将代数式转换成程序设计中的表达式为【】。
软件维护活动包括以下几类:改正性维护、适应性维护、【】维护和预防性维护。
只能作为成员函数重载的是
大多数C++程序都要包含______头文件。该文件中包含了所有输入/输出流操作所需要的基本信息。
下面是关于ios类的叙述,正确的是()。
列对派生类的描述中,错误的是()。
存在定义inta[10],x,*pa;,若pa=&a[0],下列的哪个选项和其他3个选项不是等价的?
长度为n的顺序存储线性表中,当在任何位置上插入一个元素概率都相等时,插入一个元素所需移动元素的平均个数为【】。
带一个long类型参数的流成员函数______按参数值设置flags状态变量,并返回以前设置的标志值。
随机试题
[A]Peoplewhodeceivethemselvesalsotendtobehappierthanpeoplewhodonot.Therearesocialprofits,too:Studieshave
坚持人民军队的性质,必须贯彻讲政治这个根本要求。讲政治就是要坚持( )
诊断支原体肺炎的主要依据是
对于检查、检验回报单贴放装订的整理要求,叙述错误的是
患者,男,70岁,近年来记忆力日益减退,刚做过的事情就会忘记,以前很喜欢的饭菜现在不知道如何做,记不起曾经熟悉物体的名字,常常以“这个”“那个”代替。近来由于做饭后忘记关煤气数次引起厨房失火,多次迷路,出门后回不了家。该病的病理特征是()
正常泄漏电流超过10mA时防止PE线中断导致电击危险的措施()。
下列关于增值税纳税义务发生时间的陈述,正确的有()。
Engineeringstudentsaresupposedtobeexamplesofpracticalityandrationality,butwhenitcomestomycollegeeducationIam
软件工程开发的可行性研究是决定软件项目是否能继续开发的关键,而可行性研究的结论主要相关于
Jevousprésentema_____etmon_____.
最新回复
(
0
)