首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include void f(int*P,int*q); main() { int m=1,n=2,*r=&m: f(r,&n); printf(“%d,%d”,m,n); } void
有以下程序: #include void f(int*P,int*q); main() { int m=1,n=2,*r=&m: f(r,&n); printf(“%d,%d”,m,n); } void
admin
2017-11-06
20
问题
有以下程序:
#include
void f(int*P,int*q);
main()
{
int m=1,n=2,*r=&m:
f(r,&n);
printf(“%d,%d”,m,n);
}
void f(int*p,int*q)
}
P=P+1:
*q=*q+1:
}
程序的运行结果是( )。
选项
A、2,3
B、1,3
C、l,4
D、1,2
答案
B
解析
在f(int*p,int*q)函数中,执行p=p+1是将p所对应的地址加1,而*q=*q+1是将q所指向n的地址所对应的值加1,所以m的值所对应的值没有变,而n的值则为3了,因此B选项正确。
转载请注明原文地址:https://kaotiyun.com/show/HBxp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序:main(){unsignedchara=2,b=4,c=5,d;d=a|b;d&=c;printf(“%d\n",D);}程序运行后的输出结果是()。
有以下程序段:typedefstructnode(intdata;structnode*next;)*NODE;NODEP;以下叙述中正确的是()。
有以下程序:main(){charch[]="uvwxyz",*pc;pc=ch;printf("%c\n",*(pc+5));}程序运行后的输出结果是()。
有以下程序:main(){inta[4][4]={{1,4,3,2,},{8,6,5,7,},{3,7,2,5,},{4,8,6,1,)},i,j,k,t;for(i=0;i<4;i++)for(j=0;j<3;j++)
有以下程序:point(char*p){P+=3;)main(){charb[4]={’a’,’b’,’c’,’d’},*p=b;point(p);printf("%c\n",*p);}程序运行后的输
有以下程序段:intn,t=1,S=0;scanf("%d",&n);do{s=s+t;t=t-2;}while(t!=n);为使此程序段不陷入死循环,从键盘输入的数据应该是()。
随机试题
情绪性应激原作用于下丘脑是通过________。
氯解磷定的特点是
为申请药品注册而进行的药物临床前研究包括
1.背景2009年某市一重点工程项目,采用工程量清单方式公开招标。经资格预审后,确定A、B、C、D、E共5家施工单位为合格投标人。招标人规定发放招标文件的开始时间为4月20日,截止时间为4月23日,并要求投标人在领取招标文件的同时递交投标保证金50万元,
智慧技能层次论
在党政机关公文的承办环节,()公文应当根据公文内容、要求和工作需要确定范围后分送。
下列有关“法的渊源”的表述哪些是正确的?()
Manyteachersbelievethattheresponsibilitiesforlearningliewiththestudent.(1)_____alongreadingassignmentisgiven,
Hehasnevervisitedthetown______hewasborn.
Newspapersandtelevisionoftenpresentthebadsideoflifetons.Lifeis,however,notsobad.Theworldis,onthewhole,fu
最新回复
(
0
)