fork download
  1. /******************************************************************************
  2.  
  3. Welcome to GDB Online.
  4. GDB online is an online compiler and debugger tool for C/C++.
  5. Code, Compile, Run and Debug online from anywhere in world.
  6.  
  7. *******************************************************************************/
  8. #include <iostream>
  9. #include <bits/stdc++.h>
  10. using namespace std;
  11. #include <sstream>
  12. #include <string>
  13.  
  14.  
  15. int main() {
  16.  
  17. std::string s("|");
  18.  
  19. std::stringstream exchangeByteStrStr(s.substr(1, 0));
  20. std::stringstream optionKeyStrStr(s.substr(1));
  21. std::string sout1 = exchangeByteStrStr.str().c_str();
  22. std::string sout2 = optionKeyStrStr.str().c_str();
  23.  
  24. // your code goes here
  25. cout << std::hex << "'" << exchangeByteStrStr << "'" << optionKeyStrStr<< "'" << endl;
  26.  
  27. return 0;
  28. }
  29.  
  30.  
  31.  
Success #stdin #stdout 0s 5316KB
stdin
45
stdout
'''