fork(4) 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 = new size_t(0);
  10. cout << stoi(str, pos) << "pos = " << *pos;
  11. cout << "\n" << str ;
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
127pos = 0
127[.0.0.1