相关疑难解决方法(0)

在名称空间std中没有名为stoi的成员

我正在测试std::stoi下面链接中找到的函数:http: //en.cppreference.com/w/cpp/string/basic_string/stol
但是我得到了错误:

在名称空间std中没有名为stoi的成员.

我该怎么办?请指教谢谢.

PS:我正在使用Xcode Ide来做我的c ++.

#include <iostream>
#include <string>

int main()  {
   std::string test = "45";
   int myint = std::stoi(test);
   std::cout << myint << '\n';
}
Run Code Online (Sandbox Code Playgroud)

图片

命名空间'std'中没有名为stoi的成员

错误

c++ string parsing compiler-errors string-parsing

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

c++ ×1

compiler-errors ×1

parsing ×1

string ×1

string-parsing ×1