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; }