Dynamic Float Format Specifier in C

前端 未结 2 1787
陌清茗
陌清茗 2020-12-18 23:25

Is there any way to have a user inputed float format specifier? For example, if I print this.

float c = 15.0123
printf(\"%.2f\", c);

// outputs: 15.01
         


        
2条回答
提交回复
热议问题