Hacker News new | ask | show | jobs
by poikniok 3294 days ago
Isn't this passing by pointer and not passing by reference?
2 comments

I guess technically in C everything is passed by value but you can pass a pointer to something and call it, naturally, a pass-by-pointer. Since in C you can typically get the pointer value by providing the reference (I don't remember if it is called the reference in pure C, but we are clearly talking about the same thing here) it can also be called a pass-by-reference, consistent with some other programming languages.
Pointers are a specific type reference. As they are the only type of reference built-in to the language, it is common to use the more general term "pass by reference" to mean "pass by pointer" when discussing C.