指针占用的内存
#include<stdio.h>int main()
{
int i=10,k;
int *ptr1;
printf(" Var-name Address Content \n");
printf("==========================\n");
printf(" i %d %d \n",&i,i);
printf(" k %d ? \n",&k);
ptr1=&i;
printf("ptr %d %d \n",&ptr1,ptr1);
k=*ptr1;
printf(" k %d %d %d\n",&k,*ptr1,k);
printf("\n\n");
printf("int 所占的字节数%d\n", sizeof(int));
return 0;
}
int类型为什么一下用了12个内存地址