首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下头文件: int n(); static int f2(); class MA{ public: int f3(); static int f4(); }; 在所描述的函数中,具有隐含的this指针的是( )。
有如下头文件: int n(); static int f2(); class MA{ public: int f3(); static int f4(); }; 在所描述的函数中,具有隐含的this指针的是( )。
admin
2017-07-28
36
问题
有如下头文件:
int n();
static int f2();
class MA{
public:
int f3();
static int f4();
};
在所描述的函数中,具有隐含的this指针的是( )。
选项
A、f1
B、f2
C、f3
D、f4
答案
C
解析
只有类的非静态成员函数才隐含this指针,其作用域是类内部,当类的非静态成员函数中访问类的非静态成员时,编译器会自动将对象本身的地址作为一个隐含参数传递给函数,而不必一定写上this。所以本题答案为C。
转载请注明原文地址:https://jikaoti.com/ti/Hmt0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
程序设计中最基本、最常用的控制结构是【】。
若有以下程序:#include<iostream>usingnamespacestd;classA{private:inta;public:A(inti)
有下列程序段:#include<iostream>usingnamespacestd;intmain(){charb[]="Hello,you";b[5]=0;cout
以下程序的执行结果是______。#include<iostream.h>classCSample{private:intn;staticintk:public:CSample(i
for(intx=0,y=0;!x&&y<=5;y++)语句执行循环的次数是()。
下列程序时类D代码段出现编译错误,原因是【 】。#include<iostream.h>classA{public:A(charc){cout<<"A’sconstructor."<<c<<endl
关于const修饰符的说法中,错误的是
有如下类声明;classSAMPLE{intn;public:SAMPLE(inti=0):n(i){}voidsetValue(intn0);}
C++语言本身没有定义I/O操作,但I/O操作包含在C++实现中。C++标准库iostream提供了基本的I/O类。I/O操作分别由两个类istream和()提供。
若已定义,以下fun函数的功能是在循环中给数组a前4个数组元素依次赋1、2、3、4;在第二个循环中使a数组前4个元素中的值对称折叠,变成1、2、2、1。请填空。fun(inta[]){inti;for(i=1;i<=4
随机试题
下列不属于我国德育的主要内容的是()。
关于下丘脑与垂体之间的关系的叙述,错误的是
侧脑室内脑膜瘤多位于
以下安全措施不正确的是
根据《金融理财师纪律处分办法》,以下不是对金融理财师纪律处分种类的是()。
接母题题干,其他条件不变,至2014年2月28日,甲公司发生培训成本50万元(假定均为培训人员薪酬),则甲公司如何进行账务处理?
唯物辩证法的总特征是()。
北方航空公司实行对教师机票六五折优惠,这实际上是吸引乘客的一种经营策略,该航空公司并没有实际让利,因为当某天航班的满员率超过90%时,就停售当天优惠价机票,而即使在高峰期,航班的满员率也很少超过90%。有座位空着,何不以优惠价促销它呢?以下哪项如果为真,将
DidyouwatchNBAthe55thAll-StarGame(全明星赛)?Ifyouwatchedit,you【C1】______ShaquilleO’Neal’s(沙奎尔•奥尼尔)wonderfulplay.Sh
Ironically,intheUnitedStates,acountryofimmigrants,prejudiceanddiscriminationcontinuetobeseriousproblems.Therew
最新回复
(
0
)