fork(17) download
  1. #include <string>
  2. #include <sstream>
  3. #include <iostream>
  4. int main()
  5. {
  6. std::string str="123";
  7. std::istringstream buf(str.substr(1,2));
  8. long int num;
  9. buf >> num;
  10. std::cout << num << '\n';
  11. }
Success #stdin #stdout 0.01s 2860KB
stdin
Standard input is empty
stdout
23