首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
执行语句序列 int x=1,&y=x; cout<<x<<’-’<<y<<endl; 输出结果为( )。
执行语句序列 int x=1,&y=x; cout<<x<<’-’<<y<<endl; 输出结果为( )。
admin
2019-05-06
26
问题
执行语句序列
int x=1,&y=x;
cout<<x<<’-’<<y<<endl;
输出结果为( )。
选项
A、x-x
B、1-1
C、1-0
D、异常
答案
B
解析
程序中的“int x=1”定义x为int型变量,并赋值为1。语句“&y=x”中“&”为引用运算符,&y=x语句可以理解为y具有x的地址,所以y的值也是1,即输出为:1-1。
转载请注明原文地址:https://kaotiyun.com/show/PKAp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
请将下列类定义补充完整,横线处应填加语句______。classTestClass{public:voidfun(){cout<<"Base::fun"<<end1;}};classTestClass1:publicTestClas
有如下程序:#include<iostream>usingnamespacestd;classB{public:virtualvoidshow(){cout<<"B";}};classD
有如下程序:#include<iostream>usingnamespacestd;classPart{public:Part(intx=0):val(x){cout<~Part(){cout
下列关于运算符重载的叙述中,正确的是
在函数中,可以用auto、extern、register和static这4个关键字中的一个来说明变量的存储类型,如果不说明存储类型,则默认的存储类型是
一棵二叉树中共有70个叶子结点与80个度为1的结点,则该二又树中的总结点数为
下列程序执行后,屏幕的输出是()。#include<iostream>usingnamespacestd;voidswap(intx,inty){inttemp=x;x=y;y=t
软件测试可分为白盒测试和黑盒测试。基本路径测试属于______测试。
A、 B、 C、 D、 B只有在创建对象时才会调用类的构造函数,在定义指针时不会调用构造函数,本程序共生成了3个同类对象a,b[2]。
一个项目具有一个项目主管,一个项目主管只可管理一个项目,则实体“项目主管”与实体“项目”的联系属于______的联系。
随机试题
抗体形成细胞试验是用于检测机体的
2012年12月31日甲企业科目余额表部分内容如下:“库存商品”科目借方余额100万元,“生产成本”科目借方余额150万元,“原材料”科目借方余额30万元,“材料成本差异”科目贷方余额2万元,“发出商品”科目借方余额10万元。“工程物资”科目借方余额20万
PassagethreeInhisbookTheTippingPoint,MalcolmAladuellarguesthatsocialepidemicsaredriveninlargepartbytheacting
SuccessStoriesOneofthemostsuccessfulfashioncompaniesintheworldisBenetton.TheBenettonfamilyopenedtheirfirstsh
"I’malittleworriedaboutmyfuture,"saidDustinHoffmaninTheGraduate.Heshouldbesolucky.Allhehadtoworryaboutw
I’mpleasedtotellyouthatthefaxmachinesyouorderedare______now.
FollowReportingStructure:Duringthecourseofyouremployment,followthereportingstructurewhenreportingaproblemorbri
Peoplelikebeingtrusted.Theyareannoyed,angry,orfeelhurtiftheyareregardedwith【C1】______.Theythinkthattheyare【C
TheHealthBenefitsofDrinkingWater—Isbottleddrinkingwaterhealthierthanfilteredtapwater?[A]Waterisakeyin
A、Ithelpsemployeesreducetheirstress.B、Itdistinguishesofficesfromprisons.C、Itbreakstheboundaryofhierarchy.D、Itr
最新回复
(
0
)