6 Years
Discussion Span
Last Post by rubberman

I don't want to be rude, but at least take the time to search the forum, there are dozens of threads about pointers and reference. Or google it, you will find tons of pages related to this topic. Btw, did you know, you can find C++ lectures from Stanford on youtube?

Edited by LRRR: n/a


Pointer to item == address of item in program space. A C++ reference is, under the covers, a pointer. You can pass the pointer to an object to a function, which if not specified as const, will allow the function to modify the object. This would be necessary if the function is a C function. If it is a C++ function, then it is safer to pass as a reference. Read more - this stuff is fundamental to understanding and writing good/safe C and C++ code.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.