填空题
下列程序的输出结果是
1
。 #include <stdio.h> main
2
{ int a[5]={2,4,6,8,10},*p; p=a;p++; printf("%d",*p); }
1、
【正确答案】
1、4
【答案解析】
题目中定义了一个数组和指针,接着将数组的首地址给了指针,即指针p指向数组a的第一个元素,通过p++,p指向了数组a的第二个元素,所以输出结果为4。
提交答案
关闭