std::stoi
is a function at namespace scope, taking a string as its argument:
std::string s = "123";
int i = std::stoi(s);
From the error message, it looks like you expect it to be a member of string
, invoked as s.stoi()
(or perhaps std::string::stoi(s)
); that is not the case. If that's not the problem, then please post the problematic code so we don't need to guess what's wrong with it.