#include <iostream>
#include <cstring>
using namespace std;

void func(const char *&s){
    char *result = new char[strlen(s)+1];
    strcpy(result, "new stuff");
    s = result;    
}

int main(){
    const char *str = "old stuff";
    func(str);
    std::cout << str << "\n";
    return 0; 
}
