Possible Duplicates:
Why use pointers?
Passing a modifiable parameter to c++ function
Why would I want to have pointer parameters? The only reason I can see is for small functions to attempt to reduce confusion and a smaller memory footprint.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Passing a modifiable parameter to c++ function I answered when to use a reference instead of a pointer.
Conversely, prefer a pointer to a reference when any of the following are true:
Some people also prefer a pointer when the thing that’s being pointed at should be mutated, saying that the difference between a const reference and a non-const reference isn’t obvious enough to the reader.