fork download
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. string s = "7fb8daa58000-7fb8daa5c000 r--p 0002a000 103:02 153417 /usr/lib/x86_64-linux-gnu/libtinfo.so.6.2";
  7. unsigned long r1 = strtoul((s.substr(0, s.find('-'))).c_str(), nullptr, 16);
  8. printf("%lx\n", r1);
  9. unsigned long r2 = strtoul((s.substr(s.find('-') + 1, s.find('-'))).c_str(), nullptr, 16);
  10. printf("%lx\n", r2);
  11. return 0;
  12. }
Success #stdin #stdout 0.01s 5436KB
stdin
Standard input is empty
stdout
7fb8daa58000
7fb8daa5c000