string to float conversion?

前端 未结 9 1845
-上瘾入骨i
-上瘾入骨i 2020-12-18 14:16

I\'m wondering what sort of algorithm could be used to take something like \"4.72\" into a float data type, equal to

float x = 4.72;
9条回答
  •  悲&欢浪女
    2020-12-18 14:44

    You can use boost:lexical_cast

    http://www.boost.org/doc/libs/1_44_0/libs/conversion/lexical_cast.htm

提交回复
热议问题