converting a string into a double

后端 未结 4 1361
感动是毒
感动是毒 2020-12-12 00:28

I am looking for a way to get floating point input from a user.

My way of going about this is to use a self-made getstrn function and plug that into another function

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-12 00:48

    1. Why are you not using fgets()?
    2. You're looking for atof().

    (Thanks to R. for fixing my idiotic suggestion in part 1)

提交回复
热议问题