Using printf function

后端 未结 5 829
时光说笑
时光说笑 2021-01-22 13:01

I\'ve never bothered to look for printf as I started learning C++ without C. Now i want to use formatted output in some project. so I\'m looking for some references that can exp

5条回答
  •  迷失自我
    2021-01-22 13:15

    if you don't want to use %d format specifier ,then you better Type cast it Explicitly to avoid UB(Undefined Behavior ) to be called.

    float f=1.5; printf("%d",(int)f);

提交回复
热议问题