若有定义int a[5],*p=a;,则对a数组元素不正确引用是( )
A. int a[5],*p;p=&a;
B. int a[5],*p;p=a;
C. int a[5];int *p=a;
D. int a[5];int *p1,*p2=a;*p1=*p2;
查看答案
下列代码段,( )是正确的
A. int *pointer,x;pointer=x;
B. int *pointer,x;*pointer=x;
C. int *pointer,x;pointer=&x;
D. int *pointer,x;x=&pointer;
下列程序的输出结果是____ 。main(){ char a[10]={9,8,7,6,5,4,3,2,1,0}, *p=a+5; printf("%d\n",*--p);}
设有定义a[5]={0 1 2 3 6}; *p1=&a[1]; *p2=&a[4]; 则p2-p1的值为____ ,*p2-*p1的值为____ 。
运行以下程序后结果为:#include "stdio.h"void fun(int *p1,int *p2){int x=0,y=0;printf("x=%d,y=%d\n",x,y);*p1=3+*p1;*p2=4-*p2;printf("x=%d,y=%d\n",x,y);}int main(void){int x=1,y=2;fun(&x,&y);printf("x=%d,y=%d\n",x,y);return 0;}