Answers for "from string to integer c++"

C++
3

convert string to number c++

#include <iostream>
#include <sstream>
using namespace std;
int main()
{
	string str = "123456";
 	int n;
  	stringstream ( str ) >> n;
	cout << n; //Output:123456
	return 0;
}
Posted by: Guest on April-16-2021
0

string to int c++

std::stoi( str )
Posted by: Guest on April-09-2022

Browse Popular Code Answers by Language