C 语言sizeof运算符

#include<stdio.h>
int main()
{
   int size1 = sizeof 10;
   int size2 = sizeof(10);
   int a = 10;
   int size3 = sizeof a;
   int size4 = sizeof(a);
   int size5 = sizeof(int);
   int size7 = sizeof(double);
   //int size6 = sizeof int;//错误写法
   printf("sizeof 10 :%d
",size1);
   printf("sizeof(10):%d
",size2);
   printf("sizeof a:%d
",size3);
   printf("sizeof(a):%d
",size4);
   printf("sizeof(int):%d
",size5);
   printf("sizeof(double):%d
",size7);
   return 0;
}
sizeof 10 :4
sizeof(10):4
sizeof a:4
sizeof(a):4
sizeof(int):4
sizeof(double):8
原文地址:https://www.cnblogs.com/heml/p/3525855.html