convert string to integer c++ stl code example
Example 1: convert stirng to int c++
int thing = std::stoi(string);
Example 2: how to convert from string to int in c++
#include <iostream>
#include <sstream>
using namespace std;
int main() {
string s = "999";
stringstream degree(s);
int x = 0;
degree >> x;
cout << "Value of x: " << x;
}