< Previous | Contents | Next >

Returning Pointers

Before references, the only option game programmers had for returning objects efficiently from functions was using pointers. And even though using references provides a cleaner syntax than using pointers, you might still need to return objects through pointers.

Returning Pointers 239


 

Introducing the Inventory Pointer ProgramReturning a PointerUsing a Returned Pointer to Display a ValueAssigning a Returned Pointer to a PointerAssigning to a Variable the Value Pointed to by a Returned PointerAltering an Object through a Returned Pointer