Possible Duplicate:
passing a pointer by reference in c++
I have a function that needs to modify a pointer, ex:
bool someFunc(Something* something)
{
something = somethingElse;
return true;
}
The pointer is passed by value through and is not modified. How can I modify it?
Thanks
Just change the function signature to look like
and you’ll get a modifiable pointer in
someFunc().