小编Fed*_*tti的帖子

printf("%f",x) ok, printf("%F",x) 错误格式参数太多

当我在 CodeBlocks 中使用说明符 F 时,为什么编译器给我错误“格式参数太多”?

#include <stdio.h>

int main()
{
    float x = 3.14159;
    printf("%f\n", x);
    printf("%F\n", x);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

错误:

#include <stdio.h>

int main()
{
    float x = 3.14159;
    printf("%f\n", x);
    printf("%F\n", x);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c printf codeblocks format-specifiers

6
推荐指数
1
解决办法
253
查看次数

标签 统计

c ×1

codeblocks ×1

format-specifiers ×1

printf ×1