首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
若为Fraction类重载前增1运算符++,应在类体中将其声明为( )。
若为Fraction类重载前增1运算符++,应在类体中将其声明为( )。
admin
2020-07-30
20
问题
若为Fraction类重载前增1运算符++,应在类体中将其声明为( )。
选项
A、Fraction&operator++();
B、Fraction&operator++(int);
C、friend Fraction&operator++();
D、friend Fraction&operator++(int);
答案
A
解析
在类Fraction中重载前增1运算符++时,其声明形式为Fraction&operator++();在类Fraction中重载后增1运算符十+时,其声明形式为Fraction&operatorH(int);。
转载请注明原文地址:https://kaotiyun.com/show/Gxyp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列关于运算符函数的描述中,错误的是()。
在开发一个C++程序的整个过程中,第3个步骤为()。
有如下程序:#include<iostream>usingnamespacestd;classMonkey{public:Monkey(){cout<<’M’;}Monkey(charn){cout<<n;}~Monkey(){cou
设有如下关系表:则下列操作中正确的是()。
请使用VC6或使用【答题】菜单打开考生文件夹proj3下的工程proj3,其中声明的CDeepCopy是一个用于表示矩阵的类。请编写这个类的赋值运算符成员函数operator=,以实现深层复制。要求:补充编制的内容写在“//**********333*
给定程序的主函数中,已给出由结构体构成的链表结点a、b、e,各结点的数据域中均存入字符,函数fun()的作用是:将a、b、c三个结点链接成一个单向链表,并输出链表结点中的数据。请在程序的中括号处填入正确的内容并把中括号删除,使程序得出正确的结果。
给定程序中,函数fun的功能是:利用指针数组对形参ss所指字符串数组中的字符串按由长到短的顺序排序,并输出排序结果。ss所指字符串数组中共有N个字符串,且串长小于M。请在程序的中括号处填入正确的内容并把中括号删除,使程序得出正确的结果。
在数据库设计中,将E-R图转换成关系数据模型的过程属于()。
定义派生类时,若不使用关键字显式地规定采用何种继承方式,则默认方式为()。
在一个容量为15的循环队列中,若头指针front=6,尾指针rear=9,则循环队列中的元素个数为()。
随机试题
被《文心雕龙》评为“七子之冠冕”的是【】
A.红细胞数目B.血浆总蛋白含量C.血浆球蛋白含量D.血浆白蛋白含量E.血浆NaC1含量血液的黏滞性主要取决于
关于法与社会相互关系的下列哪一表述不成立?()
城市建设用地划分为()大类。
(2006年)3d轨道的磁量子数m的合理值是()。
张某2015年5月参加幸运抽奖活动,中奖所得一辆小轿车,该小轿车的同类市场价格是150000元,国家税务总局核定同类型车辆的最低计税价格为120000元。张某应纳车辆购置税()元。
从活动水平的角度看,个体的实践活动由生理、_______和_______三种不同层次和内容的活动构成。
2018年4月4日,由美国、韩国和中国三国研究人员组成的一个国际研究团队在华盛顿开发出一款不用电池、可无线传输数据的新型传感器系统,可用于监测患者生理数据。下列关于该设备的说法,错误的是:
失业的影响为何如此之大?在【142】程度上,这是个运气问题。【143】大多数人而言,获得一份体面而有保障的全职工作,离不开运气因素。韦希特尔表示:“人们很难两次交上好运。”再培训的难度大【144】是因素之一。许多人在失业后不得不转行,这意味着他们将淡忘长期
A、Ittastesalittlebitterratherthansweet.B、Itismanufacturedinmorewine-producingareas.C、Itismadeofriceinsteado
最新回复
(
0
)