im not familiar with stoi(); function but base on the error the stoi is not a member of std
why dont you look on the header file string or search in google about using it
s1[2] is a char and "" is a const char*. There is no + operator for std::string that satisfies those parameter types. I'd wager this is the issue. Try printing s2 and see what it contains.
Something like this should work:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream>
#include <string>
int main(int argc, constchar** argv)
{
std::string s1 = "1234567890";
std::string s2 = s1[2] + std::string("");
int x = std::stoi(s2);
std::cout << "x is " << x << std::endl;
return 0;
}