fork(1) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. void remodel(string & str){
  7. string * ps = new string(str);
  8. (*ps)[0] = 'n';
  9. cout<<*ps<<endl;
  10. delete ps;
  11. }
  12.  
  13. int main(){
  14. string str = "Hello world";
  15.  
  16. remodel(str);
  17.  
  18. cin.get();
  19. return 0;
  20. }
Success #stdin #stdout 0s 4288KB
stdin
Standard input is empty
stdout
nello world