首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设程序如下: #include using namespace std; int main() { int**p,*q,r=10; q=&r; p=&q; cout
设程序如下: #include using namespace std; int main() { int**p,*q,r=10; q=&r; p=&q; cout
admin
2012-12-29
41
问题
设程序如下:
#include
using namespace std;
int main()
{
int**p,*q,r=10;
q=&r;
p=&q;
cout<<**p+1<
return 0:
}
以上程序的输出结果是( )。
选项
A、P的地址
B、r的地址
C、11
D、运行错误
答案
C
解析
p为一个二级指针,其存放的是指针变量q的地址,而q存放的又是r的地址。故式子**p相当于对r的引用。所以最后输出的结果为11。
转载请注明原文地址:https://www.kaotiyun.com/show/a5Vp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
以下选项中可用做c程序合法实数的是()。
有以下程序#include#includeintfun(intn){int*p;p=(int*)malloc(sizeof(int));*p=n;return*p;}main(){inta;a=fun(10)
已知一个文件中存放若干工人档案记录,其数据结构如下:structa{charnumber[100];intage;floatp[6];};定义一个数组:structab[10];
下列叙述中错误的是()。
有以下程序#include<stdio.h>#include<string.h>structcomputer{charCPU[10];};main(){structcomputerpc1,p
有以下程序#include<stdio.h>main(){intx;for(x=3;x<6;x++)printf((x%2):("*%d
下面描述中错误的是()。
我们所写的每条C语句,经过编译最终都将转换成二进制的机器指令。关于转换以下说法错误的是
有如下程序#include<stdio.h>main(){char*p,old_str[10]="wind";intpassword;scanf("%d",&password);p=old_
下面选项中关于编译预处理的叙述正确的是
随机试题
当我给他打电话时,他出去了。
A.急性化脓性胆囊炎B.急性化脓性胆管炎C.急性坏死性胰腺炎D.急性化脓性阑尾炎E.绞窄性肠梗阻Murphy征出现于
暑证特点,下列哪一项是错的( )
末梢血反映骨髓增生程度的最准确指标是
根据《宪法》和《组织法》的规定,下列选项正确的是:(2011—卷一—86,任)
关于甲级中央投资项目招标代理机构的资格中,有关人员和业绩说法正确的有()
反映城市土地开发强度的指标有()。
Manypeopleliketotravel.Theproblemisgettingyourpettothe【C1】______.Inrecentyears,transportingpetsonflightshas
Untilmodemtimes,atripwasoftenalonganddifficult【B1】______.Travelingbyhorseorcameloronfootwasslowandoften【B
A、Sheworksatthemeatcounter.B、Shearrangesproductsinneatpilesontheshelves.C、Shecarriesgroceriesoutofthestore
最新回复
(
0
)