What is a reference?

What exactly is a reference? What does it consist of? Contains it an address, just like a pointer?
closed account (3qX21hU5)
Google and searches are powerful things ;p

http://www.cplusplus.com/articles/1075fSEw/

and

http://www.cplusplus.com/reference/

or

http://en.wikipedia.org/wiki/Reference_(C%2B%2B)
Last edited on
It's another name for some object. You use it just like you would the object that it is another name for.

How it is implemented is not specified in the C++ standard. It may use pointers, it may not, but it is not and should not be treated like a pointer. It should be treated like another name for some exact same object.
OK, thanks.
Topic archived. No new replies allowed.