下面程序的输出结果是( )。 #include<stdio.h> main() {int a[]={1,2,3,4,5,6,7,8,7,10},*p; p=a; printf("%d\n",*p+8); }

admin2011-06-10  6

问题 下面程序的输出结果是(    )。    #include<stdio.h>    main()    {int a[]={1,2,3,4,5,6,7,8,7,10},*p;    p=a;    printf("%d\n",*p+8);    }

选项 A、0
B、1
C、10
D、9

答案D

解析 “*”号的优先级比“+”的优先级高,所以先执行“*P”:指针P指向的是数组的首地址,因此*p=1;再加8得9。
转载请注明原文地址:https://kaotiyun.com/show/YxPp777K
0

最新回复(0)