fork download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main() {
  7. string s("e 4e 00");
  8. stringstream iss(s);
  9. string cmd;
  10. int x, y;
  11. iss >> cmd;
  12. iss.ignore(1, ' ');
  13. iss >> std::hex >> x;
  14. iss.ignore(1, ' ');
  15. iss >> std::hex >> y;
  16.  
  17.  
  18. cout << cmd << endl << std::hex << x << endl << std::hex << y << endl;
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
e
4e
0