关于格式化输出的问题
#include <stdio.h>#include <math.h>
int main()
{
printf("%d",sizeof(double))
} 为什么结果会报错warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long unsigned int' [-Wformat=]
printf("%d",sizeof(double))
应该是第六行少了分号导致的 #include <stdio.h>
#include <math.h>
int main()
{
printf("%d", sizeof(double));
return 0;
} 昨非 发表于 2020-10-5 21:40
warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long unsigned int' [-Wformat=]报了这个错 787047636 发表于 2020-10-5 21:44
warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long unsigned i ...
我这里输出8,没有问题 昨非 发表于 2020-10-5 21:46
我这里输出8,没有问题
可能是vscode的锅
页:
[1]