sizeof 的运用
#define _CRT_SECURE_NO_WARNINGS
int main()
{
int a = 10;
int arr[] = { 1, 2, 3, 4, 5, 6 };
printf("%d\n", sizeof(a));//4
printf("%d\n", sizeof(int));//4
printf("%d\n", sizeof a);//4
//printf("%d\n", sizeof int);//error
printf("%d\n", sizeof(arr));//24
printf("%d\n", sizeof(arr)/sizeof(arr[0]));//6
return 0;
}
2020_2_5
原文:https://blog.51cto.com/15099264/2620607