单选题
C语言
题号 #2546340
以下程序的输出结果是( )。
void prt(int*m,int n)
{ int i;
for(i=0;i<n;i++)m[i]++;}
main()
{int a[]={1,2,3,4,5),i;
prt(a,5);
for(i=0;i<5;i++)
printf(”%d,”,a[i]);)
参考答案
B
答案解析
B。【解析】函数调用时,prt函数的作用是为使m数组ee的数自增l,因此数组下标从0开始,每个元素都自加1。
你可能感兴趣的试题
A.Prohsbn
B.Prphsbn
C.Prqgsbn
D.Program
2
若有以下的说明和语句,则在执行for语句后,*(*(pt+1)+2)表示的数组元素是( )。
im t[3][3],*pt[3],k;for(k=0;k<3;k++)pt[k]-&t[k][o];
im t[3][3],*pt[3],k;for(k=0;k<3;k++)pt[k]-&t[k][o];
A.t[2]Eo]
B.t[2][2]
C.tell[2]
D.t[2][1]
A.21,43
B.43,21
C.43,00
D.21,00