Re:A brief history of one line fixes
by ggreer on Saturday March 01, 2014 @11:38PM
(#7327723)
Everything is pass by value in C, but pointers are values. Functions can't modify the value of a pointer, but they can modify whatever's in the memory pointed to by the pointer. To change the pointer itself, you'd have to pass a pointer to a pointer. Functions like asprintf do this.
C++ added pass by reference (&), which can be a handy bit of syntactic sugar.
C++ added pass by reference (&), which can be a handy bit of syntactic sugar.