如下提示错误,为什么不能使用 atoi()函数?

语句: p1->price = atof(str.c_str());
错误:error:'atof' was not declared in this scope

米脂
浏览 67回答 2
2回答

互换的青春

_atof_l()

FFIVE

atoi atof是c语言提供的一个扩展功能,它能将一个字符串转换成对应的float或者integer。使用这些函数时,必须引入头文件#include <stdlib.h>
打开App,查看更多内容
随时随地看视频慕课网APP