dynamic_cast question...
I have a question regarding casting from one class to another... Basically i have a class called CEntity, which inherits from CObject, IRenderable and IMoveable and ICollidable...
however i want a storage class that stores a pointers to CObject classes, like:
CObject *m_object = new CEntity();
for example...
but when i want to access my CEntity class functions are hidden because the class has not yet been cast to a CEntity, right?
So i tried
CEntity *e = dynamic_cast{m_object);
but that didnt work...
what am i doing wrong?
thanks
-jonnii
Bah, damn gamedev broken angle-bracket parser...
Always give the actual error you get, not "it doesn't work".
Try dynamic_cast<CEntity *>(m_pObject);
[edited by - Anon Mike on June 27, 2002 2:35:10 PM]
Always give the actual error you get, not "it doesn't work".
Try dynamic_cast<CEntity *>(m_pObject);
[edited by - Anon Mike on June 27, 2002 2:35:10 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement