August 2001
Beginner
482 pages
10h 52m
English
In this hour, you learned what references are and how they compare to pointers. You saw that references must be initialized to refer to an existing object, and cannot be reassigned to refer to anything else. Any action taken on a reference is, in fact, taken on the reference's target object. Proof of this is that taking the address of a reference returns the address of the target.
In this hour you also examined null pointers and null references, and learned why null pointers are useful, but null references are disastrous. You went on to learn about how pass by reference semantics differ from pass by value. Finally, you saw how to use references to return multiple values from function calls.
Read now
Unlock full access