首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列运算符函数中肯定不属于类 Can 的成员函数的是
下列运算符函数中肯定不属于类 Can 的成员函数的是
admin
2021-07-02
50
问题
下列运算符函数中肯定不属于类 Can 的成员函数的是
选项
A、Can operator- (Can);
B、Can operator - ();
C、Can operator - (Can, Can);
D、Can operator - (int);
答案
C
解析
答案C的形式是重载为友元函数,而友元函数不属于类的成员函数。所以重载为友元函数需要两个参数,通过参数传递的方式得到参加运算的两个对象。其他的是重载为类的成员函数,由于对象本身代表了一个操作数,所以其参数只需要一个,其为参加运算的另一个操作数。
转载请注明原文地址:https://kaotiyun.com/show/3Yfp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有如下程序:#inc1ude<iostream>voidfun(int&x,inty){intt=x;x=y;y=t;}intmain(){i
已知递归函数fun的定义如下:intfun(intn){if(n<=1)return1;//递归结束情况elsereturnn*fun(n-2);//递归}则函数调用语句fun(5)的返回值是(
有如下类模板定义:template<typenameT>classBigNumber{longn:public:BigNumber(Ti):n(i){}BigNumberoperator
若有如下类定义:classB{voidfun1(){}protected:dOublevarl;public:voidfun2(){}};classD:publicB{protected:voidfun3(){}};己
有如下程序:#inc1ude<iostream>usingnamespacestd;c1assPoint{intx,y;public:Point(intx1=0,inty1=0):x
有如下程序:#inc1ude<iostream>usingnamespacestd;c1assB{public:virtualvoidf(){cout<<"B";}voidg(){co
下面关于构造函数和析构函数的描述中,错误的是()。
数据库系统的核心是()。
下列叙述中正确的是()。
数据的存储结构是指()。
随机试题
Mary’sclose______tohersistermadepeoplemistakethemforoneanother.
Thespyfinallygot______necessaryforhisgovernmentafteralongstayhere.
______thedifficultiesassociatedwiththeproject,we’llgoonwithit.
组胺的药理作用不包括
下列关于文学作品内容及常识的表述,不完全正确的是哪一项?()
战略控制要严格但不乏弹性,只要能保持与战略目标的一致性,保持战略实施的正确方向,就应尽可能少地干预实施过程中发生的问题,这体现了战略控制的()。
某种商品的价格连续四年环比增长率分别为5%,7%,15%,20%,该商品价格的年平均增长率为()。
Forthemostpart,thethousandsoflanguagesintheworldtodayfallintooneoftwocategories:tonalornontonal.Twolingui
Surelyprogressofaparticularkindisactuallytakingplacearoundusandisbecomingmoreandmore
A、Toputanadinthenewspaper.B、Torenovatetheapartment.C、Torenttheapartment.D、Toselltheapartment.C女士说广告上说租金是每月525
最新回复
(
0
)