< Previous | Contents | Next >

Understanding Pointers and Constants

There are still some pointer mechanics you need to understand before you can start to use pointers effectively in your game programs. You can use the keyword const to restrict the way a pointer works. These restrictions can act as safeguards and can make your programming intentions clearer. Since pointers are quite versatile, restricting how a pointer can be used is in line with the programming mantra of asking for only what you need.


 

Using a Constant PointerUsing a Pointer to a ConstantUsing a Constant Pointer to a ConstantSummarizing Constants and Pointers