首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
重载输入流运算符>>必须使用的原型为
重载输入流运算符>>必须使用的原型为
admin
2010-03-29
37
问题
重载输入流运算符>>必须使用的原型为
选项
A、istream& operator >> (istream&,<类名>&);
B、istream& operator >>(istream,<类名>);
C、istream operator>>(istream,<类名>&);
D、<类名>operator >>(istream &,<类名>&);
答案
1
解析
本题考核运算符的重载。C++中重载输入流运算符>>和输出流运算符<<只能作为非类成员函数重载,且必须使用如下原形:
istream& operator >>(istream&, <类名> &);
ostream& operator <<(ostream&, <类名>);
转载请注明原文地址:https://jikaoti.com/ti/ROW0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有以下程序:#include<stdio.h>main(){intx=1,y=2,z=3;if(x>y)if(y<z)printf("%d",++z);elseprintf("%d",++y);printf("%d\n",x++);}
以下能正确进行字符串赋值的语句组是()。
有以下程序#include#includemain(){charp[20]={’a’,’b’,’c’,’d’},q[]="abc",r[]="abcde";strcat(p,r);strcpy(p+strlen(q),q)
有以下程序structS{inta;intb;};main(){structSa,*p=&a;a.a=99;printf("%d\n",___________);}程序要求输出结构体中成员a的数据
函数rewind(fp)的作用是()。
下列关于逻辑运算符两侧运算对象的叙述中正确的是()。
有以下程序,其中%u表示按无符号整数输出()。main(){unsignedintx=0xFFFF;/*x的初值为十六进制数*/printf("%u\n",x);}程序运行后的输出结果是()。
有下列程序,其中%u表示按无符号整数输出。main(){unsignedintx=0xFFFF;/*X的初值为十六进制数*/printf(“%u\n”,x);}程序运行后的输出结果是()。
若有函数首部intfun(doublex[10],int*n),则下列针对此函数的函数声明语句中正确的是()。
若有函数首部intfun(doublex[10],int*n),则下列针对此函数的函数声明语句中正确的是()。
随机试题
不管是单向超越离合器还是双向超越离合器,其星轮都是()个。
组织行为学是一门具有两重性的学科,其应用的带有阶级性的学科是()
甲被外派到某国出差,乙听说后委托甲在国外为乙购买一套音响设备。后来甲回国之后,将音响送到乙家里,发现乙已经去世。乙的儿子丙以乙已经死亡为由不接收音响。关于甲的代理行为的法律后果由谁承受,下列说法正确的是:
根据购买力平价理论,关于货币购买力的说法,正确的是()。
教育系统培养多少劳动力以及培养多少简单劳动力、多少复杂劳动力的决定因素是()
根据所给图表、文字资料回答问题。表中国家按所属大洲分类,2004年出国旅游人数均值最高的是()
辛亥革命在比较完全的意义上说是中国的资产阶级民主革命,是因为资产阶级革命派()
Whyaretheagesofonetofouradangeroustimeinyoungkids’life?
ThedealwithSpeedShippingrepresentsthe______largestsaleofcontainershipsinrecentyears.
Stressiswithusallthetime.Itcomesfrommentaloremotionalactivityaswellasphysicalactivity.Itisuniqueandperson
最新回复
(
0
)