|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
//Chapter1/test5.c
#include <stdio.h>
int main(void)
{
printf("int = %d\n", sizeof(int));
printf("short int = %d\n", sizeof(short));
printf("long int = %d\n", sizeof(long));
printf ("long long int = %d\n", sizeof(long long));
printf("char = %d\n", sizeof(char));
printf("_Bool = %d\n", sizeof(_Bool));
printf("float = %d\n", sizeof(float));
printf("double = %d\n", sizeof(double));
printf("long double = %d\n", sizeof(long double));
return 0;
}
10 32 E:\360data\重要数据\桌面\1\test5.cpp [Error] '_Bool' was not declared in this scope
加上 #include <stdbool.h>
- #include <stdio.h>
- #include <stdbool.h> # 加上这行才能使用_Bool
- int main(void)
- {
- printf("int = %d\n", sizeof(int));
- printf("short int = %d\n", sizeof(short));
- printf("long int = %d\n", sizeof(long));
- printf ("long long int = %d\n", sizeof(long long));
- printf("char = %d\n", sizeof(char));
- printf("_Bool = %d\n", sizeof(_Bool));
- printf("float = %d\n", sizeof(float));
- printf("double = %d\n", sizeof(double));
- printf("long double = %d\n", sizeof(long double));
-
- return 0;
- }
复制代码
|
|