C language: scanf function producing different results with float and double types?

前端 未结 1 1863
梦毁少年i
梦毁少年i 2021-01-25 08:16
    **Code A returns the correct conversion: 6.55957.**

    #include 
    #include 
    #include 

    float convert(float          


        
1条回答
  •  南笙
    南笙 (楼主)
    2021-01-25 08:47

    The correct format specifier for double is %lf, not %f.

    0 讨论(0)
提交回复
热议问题