void func(char*& foo) { char* bar = new char[1000]; //allocating more space somewhere else //some stuff if (foo != null) delete [] foo; //clean up, if there's something here foo = bar; }
char* string = "text"; func(string);
std::string
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)