C++ pointer strangeness

Started by
9 comments, last by PureSnowX 11 years, 5 months ago

You're passing the pointer by value. Assignments to the pointer inside the function won't be visible to the calling function. You can try using a reference to a pointer (char *&) instead.

This, or using a pointer to pointer has the same result: void function(Foo** foo) then to assign something new: *foo/(*foo) = <VALUE>

This topic is closed to new replies.

Advertisement