|
发表于 2021-8-27 14:25:21
|
显示全部楼层
你的 gcc 不提示,我这边的 gcc 提示说 lf 不对,应该是 Lf
- main.c: In function ‘main’:
- main.c:10:20: warning: format ‘%lf’ expects argument of type ‘double’, but argument 2 has type ‘long double’ [-Wformat=]
- 10 | printf("c=%6.2lf,s=%6.2lf",c,s);
- | ~~~~~^ ~
- | | |
- | double long double
- | %6.2Lf
- main.c:10:29: warning: format ‘%lf’ expects argument of type ‘double’, but argument 3 has type ‘long double’ [-Wformat=]
- 10 | printf("c=%6.2lf,s=%6.2lf",c,s);
- | ~~~~~^ ~
- | | |
- | | long double
- | double
- | %6.2Lf
复制代码 |
|