fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. int main() {
  5. std::string x("foo\0bar", 7);
  6.  
  7. for (std::string::iterator i = x.begin(); i != x.end(); ++i) {
  8. std::cout << std::hex << static_cast<int>(*i) << std::endl;
  9. }
  10. }
Success #stdin #stdout 0.02s 2856KB
stdin
Standard input is empty
stdout
66
6f
6f
0
62
61
72