#include <stdio.h> int main() { int a=0; int arr[10]={0}; printf("%d\n",sizeof(a)); //结果为4 printf("%d\n",sizeof(arr)); //结果为40 printf("%d\n",sizeof(arr[0])); //结果为4 printf("%d\n",sizeof(arr[10])); //结果为4 printf("%d\n",sizeof(&arr)); //结果为40 printf("%d\n",sizeof(&arr[0])); //结果为4 printf("%d\n",sizeof(&arr[10])); //结果为4 printf("%d\n",sizeof(&a)); //结果为4 printf("-----%d\n",sizeof(++a)); //结果为-----4 printf("+++++%d\n",a); //结果为+++++0 return 0; }
时间: 2024-12-05 01:53:21