I think it's important to note that passing a pointer by value is not pass by reference.
Passing the pointer by value grants the means to reference the thing pointed at on the other side, but it doesn't have pass-by-reference semantics.
e.g., this code can't change the value of p, so bar will always receive a null pointer value.
{ int *p = 0; foo(p); bar(p); }
If p were passed by reference then the value of p could be changed by the call to foo.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think it's important to note that passing a pointer by value is not pass by reference.
Passing the pointer by value grants the means to reference the thing pointed at on the other side, but it doesn't have pass-by-reference semantics.
e.g., this code can't change the value of p, so bar will always receive a null pointer value.
If p were passed by reference then the value of p could be changed by the call to foo.