View Single Post
Old Jun 12th, 2005, 2:35 PM   #10
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
There is definitely a difference between a "reference" per C++ definition and a pointer. The choice of the term, "reference" for C++, was a little shaky, as pointers, labels, nicknames, aliases, are ALL references. However, one cannot pass a "reference" (as defined in C++) in C. The "&" operator is strictly an address-of operator and the use inside the function has to be the same as when dereferencing a pointer. In C++, on the other hand, a "reference" is an alias and a passed reference amounts to one fewer levels of indirection.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote