Summary


In this chapter, you learned what pointers are and how to use them. The chapter demonstrated that your programs can use pointers to dynamically allocate memory. Whenever a program is through with dynamically allocated memory, it can free the memory for other uses.

Dynamic memory allocation can cause memory leaks. As a result, you should get into the habit of freeing all memory you allocate.

Pointers can be used with inheritance. It enables programs to use base class pointers to call derived class member functions. This is a technique that games rely on quite heavily.

Pointers and arrays are closely related. You can use array notation with pointers. Doing so often makes pointers easier to manage.



Creating Games in C++(c) A Step-by-Step Guide
Creating Games in C++: A Step-by-Step Guide
ISBN: 0735714347
EAN: 2147483647
Year: N/A
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net