Answers for "how to use stoi() to convert a string in int in c++"

C++
2

c++ string to integer without stoi

#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;
}
Posted by: Guest on June-16-2020

Code answers related to "how to use stoi() to convert a string in int in c++"

Browse Popular Code Answers by Language