A-A+
以下程序的运行结果是()#include<stdio.h>main(){int a[]={1
问题详情
以下程序的运行结果是()
#include<stdio.h>
main()
{
int a[]={1,2,3,4,5,6,7,8,9,10,11,12};
int *p=&a[5],*q=NULL;
printf("%d%dn",*p,*q);
}
A.运行后报错
B.6 0
C.6 12
D.5 5
参考答案
正确答案:A
A
[解析]
#include<stdio.h>
main()
{
int a[]={1,2.3.4,5,6,7,8,9,10,11,12};
int *p=&a[5],*q=NULL;
printf("%d%d\n",*P,*q);/*被置空的指针不能参与"*"运算*/
}