Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

convert string to number c++

//stoi() : The stoi() function takes a string as an argument and 
//returns its value. Supports C++11 or above. 
// If number > 10^9 , use stoll().
#include <iostream>
#include <string>
using namespace std;
main() {
	string str = "12345678";
	cout << stoi(str);
}
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #convert #string #number
ADD COMMENT
Topic
Name
1+2 =