单项选择题

若有以下程序:
#include <stdio.h>
int a[]=1,3,5,7;
main()
int i;
int *p=a;
for(i=0;i<4;i++)a[i]=*p;
printf("%d\n",a[2]);

上面程序的输出结果是

A) 5
B) 7
C) 1
D) 3
<上一题 目录 下一题>
热门 试题

单项选择题
以下数组定义中错误的是
A) int x[][3]=0;
B) int x[2][3]=1,2,3,4,5,6;
C) int x[][3]=1,2,3,4,5,6;
D) int x[2][3]=1,2,3,4,5,6;
单项选择题
有以下程序: #include <string.h> main() char p[]='a','b','c',q[10]='a','b','c'; printf( %d%d n ,strlen(p),strlen(q)); 以下叙述中正确的是
A) 在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3
B) 由于p数组中没有字符串结束符,长度不能确定;但q数组中字符长度为3
C) 由于q数组中没有字符串结束符,长度不能确定;但p数组中字符长度为3
D) 由于p和q数组中没有字符串结束符,故长度都不能确定
相关试题
  • 变量a中的数据用二进制表示的形式是010...
  • 有以下程序: #include <stdio.h> m...
  • 设有定义: struct complex int real,...
  • 有以下程序: main() char ch[]= ...
  • 有以下程序: #include <stdio.h> m...