问题 单项选择题

以下程序的运行结果是( ) #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); }

A.运行后报错

B.6 0

C.6 12

D.5 5

答案

参考答案: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);/*被置空的指针不能参与"*"运算*/ }

单项选择题
判断题