< Previous | Contents | Next >
Advanced Classes and Dynamic Memory: Game Lobby
C++ gives a game programmer a high degree of control over the computer. One of the most fundamental abilities is direct control over memory. In this chapter, you’ll learn about dynamic memory—memory that you manage yourself. But with great power comes great responsibility, so you’ll also see the pitfalls of dynamic memory and how to avoid them. You’ll learn a few more things about classes, too. Specifically, you’ll learn to:
n Combine objects
n Use friend functions
n Overload operators
n Dynamically allocate and free memory
n Avoid memory leaks
n Produce deep copies of objects