#include <iostream> #include <string> int main() { std::string str = "12345"; int num; num = std::stoi(str); std::cout << num; return 0; }