fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. std::string str = "123q";
  7.  
  8. int i = atoi(str.c_str());
  9. std::cout << i << std::endl;
  10. return 0;
  11. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
123