Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
}
 
PREVIOUS NEXT
Tagged: #convert #string #number
ADD COMMENT
Topic
Name
1+6 =