Pointers are also great when you get into class hierarchies. A pointer to a base class can point to an object of any class derived from that base class. Then, when you don't know the actual class type until Run Time, you can adapt to the situation at hand. Let's say we're going to have a pointer to a pet in a game (stupid example - bear with me).
class Animal;class Dog : Public Animal;class Cat : Public Animal;Animal *pet
Now you're pointer *pet can point to a Dog or a Cat object. Nice.
I love pointers!!
-Kirk
[edited by - KirkD on January 30, 2003 2:05:10 PM]