M
mandatory
hi,
i have a pointer to a class, which is dynamically allocated with new.
myClass *mC = new myClass();
What if i at a later point in my code i have this:
void *pointer;
pointer = (void*)myClass;
...
....
delete pointer;
Will this work at all ? if you say it does, what if i have a destructor on
the class, i guess the compiler cant recognize it as the class type right -
but lets say its only a datasegment with X bytes in a struct, will it work
then ?
i have a pointer to a class, which is dynamically allocated with new.
myClass *mC = new myClass();
What if i at a later point in my code i have this:
void *pointer;
pointer = (void*)myClass;
...
....
delete pointer;
Will this work at all ? if you say it does, what if i have a destructor on
the class, i guess the compiler cant recognize it as the class type right -
but lets say its only a datasegment with X bytes in a struct, will it work
then ?