fork(2) download
  1. #include <string>
  2. #include <iostream>
  3.  
  4. int main() {
  5. std::string const original = "Hello, World!";
  6. std::string copy = original;
  7.  
  8. char* c = const_cast<char*>(copy.c_str());
  9. c[0] = 'J';
  10.  
  11. std::cout << original << "\n";
  12. }
Success #stdin #stdout 0.02s 2856KB
stdin
Standard input is empty
stdout
Jello, World!