delete a structure pointer, but type is changed to char* ?
December 24, 2009 - 9:51 pm
I have one structure called "abc".
So,
abc *pabc = new abc;
char* pChar = (char*)pabc;
delete pChar;
// is the above statement is valid in C++. is there any memory leak !
In most cases this will work, but it is not guaranteed to work and so it should be avoided.
December 25th, 2009 at 3:24 am
In most cases this will work, but it is not guaranteed to work and so it should be avoided.
References :