C 语言中基本数据类型的sizeof大小

来源:互联网 发布:巴蒂斯图塔意甲数据 编辑:程序博客网 时间:2024/05/22 15:49
#define SIZE_OF(TYPE)                                    \  do {                                                   \      printf ("sizeof ("#TYPE") = %d\n", sizeof (TYPE)); \  } while (0);int main (void){#ifdef CPP  SIZE_OF (bool); /* only defined in CPP */#endif  SIZE_OF (xtbool);  SIZE_OF (xtbool4);  SIZE_OF (xtbool8);  SIZE_OF (char);  SIZE_OF (short);  SIZE_OF (int);  SIZE_OF (long);  SIZE_OF (long long);  SIZE_OF (float);  SIZE_OF (double);  SIZE_OF (long double);    /* Conditional Move related vectorMode.  */  SIZE_OF (float16);  SIZE_OF (float32);    SIZE_OF (cfloat16);  SIZE_OF (vfloat8x16);  SIZE_OF (vfloat4x32);    return 0;}

0 0
原创粉丝点击