指针与数组名区别实例

#include<stdio.h>
/*int main()
{
 int *a=NULL;
 int b[5]={0,1,2,3,4};
 a=b+0;//&b[0];
 printf("a=%x,b=%x\n",a,b); 
}*/
main()
{
 short *a=NULL;
 short *c=NULL;
 short b[5]={90,92,60,88,76};
 a=b+1;
 c=a++;
 printf("a=%x,*a=%d\n",a,*a);
 printf("b=%x,*b=%d,*(b+3)=%d\n",b,*b,*(b+3));
 printf("c=%x,*c=%d\n",c,*c);
}
上一篇:谈谈结构体


下一篇:short相加自动转化为INT