@MikeyBoy and @MiiNiPaa,
I agree with you completely, but there is some history of calling addresses "references". Our own tutorial (
http://www.cplusplus.com/doc/tutorial/pointers/) refers to '&' as the "Reference operator". That should probably be cleaned up.
@jt1,
believe it or not, turbo c++ 1 calls the & for addresses a reference. |
Back when I learned C (about 20 some years ago), when we had functions that took pointers as arguments, the instructor referred to that as pass by reference. The pointer was an address of (or "reference" to) a variable or struct, and could be manipulated by the function being called. Turbo C++ 1 came out around that time, which was pre-standard. Calling pointers "references" would have been understandable (to some extent) to programmers familiar with C pointers.
When C++ became more robust, the term
reference
took on a whole new meaning. A C++ reference is completely distinct from a pointer. When using the term "reference" to describe a pointer (address), you completely dismiss the C++ reference construct (and you don't even seem to be aware of it). While some refer to the "address-of operator" as the "reference operator", the operator returns an
address, not a
reference. That terminology needs to be stamped out, and old, pre-standard compilers don't make that any easier.
Turbo C++ 1 is a
VERY old compiler and should be retired by now. Find yourself a new compiler and learn some of the new features of standard C++.