- #include <stdio.h>
- int main()
- {
- int a[]={1,2,3};
- int *h=&a[0]; //&a[0]也可以写成a
- printf("*a=%d\n",*a);
- printf("*(a+1)=%d\n",*(a+1));
- double b1=1.1;
- double *i=&b1;
- char c1='a';
- char *j=&c1;
- printf("h=%lu\ti=%lu\tj=%lu\ta=%lu\n",sizeof(h),sizeof(i),sizeof(j),sizeof(a));
- h=h+1;
- printf("h=%p\n",h);
- h=a;
- printf("h=%p\n",h);
- return 0;
- }
复制代码
|
|