Here a basic code I'm trying to run But I'm having trouble with stoi (it's c++) I keep getting error: 

```
‘stoi’ was not declared in this scope

```

I tried atoi and strtol with this error 

```
.cpp:23: error: cannot convert ‘std::string’ to ‘const char*’ for argument ‘1’ to ‘int atoi(const char*)’

```

The code:

```
using namespace std;

int main(){
    string numberGuessed;
    int intNumberGuessed = 0;
    do {
        cout << "Guess a numeber btw 1 - 10: " << endl;
        getline(cin, numberGuessed);
        intNumberGuessed = atoi(numberGuessed);
        cout << intNumberGuessed << endl;
    } while(intNumberGuessed != 4);
    cout<< "you win" << endl;
    return 0;
}

```