fork download
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <string.h>
  4. using namespace std;
  5.  
  6. void f(char x[2], int index, char value){
  7. x[index]=value;
  8.  
  9. }
  10.  
  11.  
  12. int main(int argc, char**argv) {
  13. char a[]="123456789";
  14. strcpy(&a[2], "pippo");
  15. f(&a[6], 1, '$');
  16. cout<<a;
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
12pippo$9