首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
以下程序的输出结果是 #include int a[3][3]={1,2,3,4,5,6,7,8,9,},*p; main( ) { p=(int *)malloc(sized(int)); f(p,a) ;
以下程序的输出结果是 #include int a[3][3]={1,2,3,4,5,6,7,8,9,},*p; main( ) { p=(int *)malloc(sized(int)); f(p,a) ;
admin
2010-09-05
14
问题
以下程序的输出结果是
#include
int a[3][3]={1,2,3,4,5,6,7,8,9,},*p;
main( )
{ p=(int *)malloc(sized(int));
f(p,a) ;
printf("%d\n",*p);
free(p);}
f(int *s,int p[ ][3])
{ *s=p[1][1];}
选项
A、1
B、4
C、7
D、5
答案
D
解析
本题考查了二维数组元素引用的方法。题中用动态存储分配函数malloc分配了一个int型数据长度大小的内存,然后指针p指向了这段内存,函数f( )中对p所指向的数据进行了赋值,p[1][1]为二维数组第二行第二列的元素,对应于实参a的元素5,所以输出结果为5。
转载请注明原文地址:https://kaotiyun.com/show/HMWp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下面程序计算并输出的是()。PrivateSubCommand1_Click()Num=10:Sum=0DoSum=Sum+Num*Num*NumNum=Num-1LoopUntilNum<=0PrintSumEndSu
(1)在考生文件夹下有一个工程文件sjt3.vbp。窗体上有一个标题为“得分”的框架,在框架中有一个名称为Text1的文本框数组,含六个元素;义本框Text2用来输入难度系数。程序运行时,在左边的六个文本框中输入6个得分,输入难度系数后,单击“计算分数”按
下面不属于软件需求分析阶段主要工作的是
以下叙述中错误的是()。
对关系S和R进行集合运算,结果中既包含S中的所有元组也包含R中的所有元组,这样的集合运算称为()。
假定有以下循环结构:DoUntil条件表达式 循环体Loop则以下正确的描述是( )。
将E-R图转换为关系模式时,实体和联系都可以表示为( )。
一间宿舍可住多个学生,则实体宿舍和学生之间的联系是()。
从键盘上输入一个浮点数asingle,利用字符串函数对该数进行处理后,如果输出的内容不是“非浮点数”,则对程序输出的内容分析正确的是()。asingle=InputBox("请输入一个浮点数:")strl$=Str$(asing
软件工程的理论和技术性研究的内容主要包括软件开发技术和
随机试题
某学校与某塑钢窗加工厂签订了一份承揽加工塑钢窗合同,由其向塑钢窗加工厂提出工作要求,按约定接受工作成果并给付酬金。该学校称为()。
下列关于通货膨胀效应的说法不正确的是()。
布置轻型井点降水时,当基坑或沟槽宽度小于6m,且降水深度不大于5m时采用( )井点方式。
起重机能吊起的重物或物料的静质量称为()。
会计凭证是会计人员根据审核无误的原始凭证,按照经济业务的内容加以归类,并据以确定会计分录后填制的,是登记账簿的直接依据。()
某市晚报为了评估市民对该报的欢迎程度,抽样调查了210人对阅读该报后自己的评论意见,各类人员、各种评价意见的统计结果列表如下: 该统计表中(67)。
(电子表格题)李晓玲是某企业的采购部门员工,现在需要使用Excel来分析采购成本并进行辅助决策。根据下列要求,帮助她运用已有的数据完成这项工作。为“成本分析”工作表的单元格区域E2:H15套用一种表格格式,并将表名称修改为“成本分析”;根据表“成本分析
Heinvestedaconsiderableamountofmoneyintheproject.
Lookatthechartsbelow.Theyshowprofitsbeforetaxandprofitmarginsforeightdifferentcompaniesfrom1998to2002Which
Whenhelivedinthatremoteplace,radiowastheonlymeanshehadtokeep________ofcurrenteventsinthecountry.
最新回复
(
0
)