linked lists and classes

Started by
1 comment, last by Marty666 19 years, 7 months ago
Hi all. I have a class called CPhysicsObject and a lot of other classes that are defined CLASSNAME : public CPhysicsObject. Since I want to update the physics variables of the objects all at the same time I'd like to put them in a (double) linked list then run through the list and update them. The only problem is that I don't know what to point to, since I don't know what class the next object would be. I only know that its a ' : public CPhysicsObject'... Can I create a pointer pointing to the class (CLASSNAME : public CPhysicsObject) with a pointer to a basic CPhysicsObject? Thanks, Marty PS: I'm Dutch and don't know what it's called in English when a class is derrived from another. So that information is welcome too :D.
_____ /____ /|| | || MtY | ||_____|/Marty
Advertisement
Yes. This is the essence of polymorphism. Read up on virtual and protected.
Thanks a lot!
_____ /____ /|| | || MtY | ||_____|/Marty

This topic is closed to new replies.

Advertisement