C
Charles Zhang
I want to know to the following in a safe manner (the following code
will be dangerous if p does not contain a pointer to MyClass). I would
like someone to show me a better way (either throw an exception or
return value which I can check if the cast is allowed or not.
void* p;
...
MyClass* pClass = (MyClass*)p;
Thank you very much for your help.
Charles Zhang
will be dangerous if p does not contain a pointer to MyClass). I would
like someone to show me a better way (either throw an exception or
return value which I can check if the cast is allowed or not.
void* p;
...
MyClass* pClass = (MyClass*)p;
Thank you very much for your help.
Charles Zhang