C++中为什么不能使用 atoi()函数? 使用codebloks 10.05 版本。

语句: p1->price = atof(str.c_str());

错误:error:'atof' was not declared in this scope

atoi atof是c语言提供的一个扩展功能,它能将一个字符串转换成对应的float或者integer。
使用这些函数时,必须引入头文件
#include <stdlib.h>
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-11-15
_atof_l()
相似回答