fork(1) download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7.  
  8. string str = "127[.0.0.1";
  9. size_t pos (0);
  10. cout << stoi(str, &pos);
  11. cout << "pos = " << pos;
  12. cout << "\n" << str ;
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
127pos = 3
127[.0.0.1