首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
已知Value是一个类,Value是Value的一个对象。下列以非成员函数形式重载的运算符函数原形中,正确的是( )。
已知Value是一个类,Value是Value的一个对象。下列以非成员函数形式重载的运算符函数原形中,正确的是( )。
admin
2020-04-07
80
问题
已知Value是一个类,Value是Value的一个对象。下列以非成员函数形式重载的运算符函数原形中,正确的是( )。
选项
A、Value operator+(Value v,int i);
B、Value operator+(Value v=value,int i);
C、Value operator+(Value vint i=0);
D、Value operator+(Value v=value,int i=0);
答案
B
解析
此题考查的是重载加法运算符“+”。“+”是二元运算符,其第一操作数是对象本身,i为第二操作数,由此可知选项B正确。
转载请注明原文地址:https://kaotiyun.com/show/938p777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下面程序中错误之处是______。#include<iostream.h>classA{private:intxl;protected:intx2;
以下程序的执行结果是______。#include<iostream.h>classA{inta;public:voidseta(intx
下列对模板的声明中正确的是()。
下列程序将x、y和z按从小到大的顺序排列,请将下面的函数模板补充完整。template<classT>voidorder(){Talif(x>y){a=x;x=y;y=a;}
若有以下程序:#include<iostream>usingnamespacesstd;classA{public:A(){}A(inti){
语句ofstreamf("DATA.DAT",ios_base::app|ios_base::binary);的功能是建立流对象f,并试图打开文件DATA.DAT并与之连接,而且
在下列关系运算中,不改变关系表中的属性个数但能减少元组个数的是
有如下类的定义。空格处的语句是()。classMyClass{____________intx,y;public:MyClass(inta=0,intb=0
下列叙述中正确的是()。
随机试题
外观检验能发现的焊接缺陷是()。
在脊髓后索通过的传导束是
男,49岁,既往体健,因头晕半天、黑便3次急诊入院。血压80/50mmHg,心率124次/分,面色苍白,冷汗。急救措施首选
求下列微分方程的通解。y’-xy’=a(y2+y’)
WhichofthefollowingisNOTtrueabouttheHouseofCommonsinBritain?
NowadaysInternetisrevolutionizingourglobeandgreatlyfacilitatingourmodernlife.Asamatteroffact,wecandoalmoste
A、Doctorandpatient.B、Teacherandstudent.C、Husbandandwife.D、Saleswomanandcustomer.D背景推断题。该题要求判断对话双方之间的关系。对话中,女士说,“收音机8
Thegreatestbenefitofsciencehasbeen______.Accordingtothepassagetheauthortendstobeallthefollowingbutnotthe
Opportunitiesforrewardingworkbecomefewerforbothmenandwomenastheygrowolder.Afterage40,jobhuntingbecomeseven
Howmenfirstlearnedtoinventwordsisunknown;inotherwords,theoriginoflanguageisa【C1】______.Allwereallyknowis
最新回复
(
0
)