跳转到内容

atof

float  atof(string str)

将字符串转换为浮点数值。

  • 该函数会忽略数字周围的空白字符。
  • 如果字符串不包含数字,则返回 0.0
  • 字符串可以包含指数表示法(例如 "1.25e+5")。