< Previous | Contents | Next >

Returning References

Just like when you pass a value, when you return a value from a function, youre really returning a copy of the value. Again, for values of the basic built-in types, this isnt a big deal. However, it can be an expensive operation if youre returning a large object. Returning a reference is an efficient alternative.

Returning References 199


 

Introducing the Inventory Referencer ProgramReturning a ReferenceDisplaying the Value of a Returned ReferenceAssigning a Returned Reference to a ReferenceAssigning a Returned Reference to a VariableAltering an Object through a Returned Reference