柠檬试题库
search
首页
计算机
公务员
驾照
关于
share
有以下程序 #include
#include
void fun( int *p1, int *p2, int *s) { s=( int*)calloc(1,sizeof(int)); *s=*p1+*p2; free(s); } main() { int a[2]={1,2}, b[2]={40,50},*q=a; fun(a,b,q); printf("%d\n", *q); } 程序运行后的输出结果是
A.42
B.41
C.1
D.0
热度🔥501
参考答案:C
解析:
【解析】本题考查把数组名作为函数参数,执行fun函数后,s的值并没有发生变化,仍然是指向a,所以输出结果为1,选项C正确。
复制题目向AI提问
content_copy
content_copy
扫码免费计算机二级刷题
2025年计算机等级考试题库
推荐
下列关于栈叙述正确的是( )。
命令按钮Command1的事件过程如下:Private Sub Command1_Click() Dim arr(5, 5)As Integer Dim i As Integer, j As Integer For i=1 To 4 For j=2 To 4 arr(i, j)=i+j Next j Next i Print arr(1, 3)+arr(3, 4)End Sub执行上述过程,输出结果是( )。
在不同类型的操作系统中,批处理操作系统的缺点是
标签
二级C语言
int
fun
函数
输出