Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: