I am testing out std::stoi
function found in the link below:
http://en.cppreference.com/w/cpp/string/basic_string/stol
but I got the error:
No Member named stoi in namespace std.
What should I do? Please advise thanks.
P.S: I am using Xcode Ide to do my c++.
#include <iostream>
#include <string>
int main() {
std::string test = "45";
int myint = std::stoi(test);
std::cout << myint << '\n';
}
Image