adkt
1/22/2015 - 11:51 PM

Convert String to Int

Convert String to Int

#include <iostream>
#include <sstream>
#include <string>

int main()
{
	std::string numAsString = "2341";
	int num;
	std::istringstream(numAsString) >> num;
	std::cout << "int is: " << num * 2;
}