Click here to Skip to main content
15,907,326 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: check box problem Pin
Mark Salsbery28-Jan-08 7:02
Mark Salsbery28-Jan-08 7:02 
GeneralVC++&Fortran mixed-language string problem Pin
raulisme27-Jan-08 19:37
raulisme27-Jan-08 19:37 
GeneralRe: VC++&Fortran mixed-language string problem Pin
Iain Clarke, Warrior Programmer27-Jan-08 21:54
Iain Clarke, Warrior Programmer27-Jan-08 21:54 
GeneralVery well said! Pin
jhwurmbach27-Jan-08 22:04
jhwurmbach27-Jan-08 22:04 
GeneralRe: Very well said! Pin
Maxwell Chen27-Jan-08 22:10
Maxwell Chen27-Jan-08 22:10 
AnswerRe: Very well said! Pin
Iain Clarke, Warrior Programmer27-Jan-08 22:18
Iain Clarke, Warrior Programmer27-Jan-08 22:18 
Generaldeletion of void pointer Pin
Member 310062427-Jan-08 19:36
Member 310062427-Jan-08 19:36 
GeneralRe: deletion of void pointer Pin
Nibu babu thomas27-Jan-08 21:18
Nibu babu thomas27-Jan-08 21:18 
Member 3100624 wrote:
my question is whether the XYZ object will be properly deleted thru the pvoid pointer WITHOUT typecasting? If the answer is no, then how does the 'free' delete using void pointers without knowing the amount of blocks that are to be freed?


Well the pointer will be deleted but not properly. The reason being that deleting a void pointer won't call that pointer's destructor function which will result in leaks if you have nested objects which in turn allocate memory.

Always pair "new" and "delete". Don't try to "new" and then use "free". "new" calls the constructor and "delete" calls the destructor. This allows all nested objects(which relies on the container class's destructor) to free themselves properly.


Nibu thomas
Microsoft MVP for VC++


Code must be written to be read, not by the compiler, but by another human being.

Programming Blog: http:\\nibuthomas.wordpress.com

GeneralRe: deletion of void pointer Pin
Iain Clarke, Warrior Programmer27-Jan-08 22:22
Iain Clarke, Warrior Programmer27-Jan-08 22:22 
GeneralRe: deletion of void pointer Pin
Nibu babu thomas27-Jan-08 23:44
Nibu babu thomas27-Jan-08 23:44 
GeneralRe: deletion of void pointer Pin
Iain Clarke, Warrior Programmer28-Jan-08 0:05
Iain Clarke, Warrior Programmer28-Jan-08 0:05 
GeneralDoubt!!!! Pin
rowdy_vc++27-Jan-08 19:17
rowdy_vc++27-Jan-08 19:17 
GeneralRe: Doubt!!!! Pin
Hamid_RT27-Jan-08 20:50
Hamid_RT27-Jan-08 20:50 
GeneralRe: Doubt!!!! Pin
rowdy_vc++27-Jan-08 22:17
rowdy_vc++27-Jan-08 22:17 
GeneralRe: Doubt!!!! Pin
vijay_aroli27-Jan-08 22:31
vijay_aroli27-Jan-08 22:31 
GeneralRe: Doubt!!!! Pin
Maxwell Chen27-Jan-08 22:36
Maxwell Chen27-Jan-08 22:36 
GeneralRe: Doubt!!!! Pin
vijay_aroli27-Jan-08 22:51
vijay_aroli27-Jan-08 22:51 
GeneralRe: Doubt!!!! Pin
rowdy_vc++27-Jan-08 23:21
rowdy_vc++27-Jan-08 23:21 
GeneralRe: Doubt!!!! Pin
David Crow28-Jan-08 6:21
David Crow28-Jan-08 6:21 
GeneralDrag image on to the explorer Pin
revanth198527-Jan-08 19:07
revanth198527-Jan-08 19:07 
GeneralRe: Drag image on to the explorer Pin
Hamid_RT27-Jan-08 20:49
Hamid_RT27-Jan-08 20:49 
GeneralRe: Drag image on to the explorer [modified] Pin
revanth198527-Jan-08 23:52
revanth198527-Jan-08 23:52 
GeneralUncaught exception Pin
George_George27-Jan-08 19:01
George_George27-Jan-08 19:01 
GeneralRe: Uncaught exception Pin
Maxwell Chen27-Jan-08 19:31
Maxwell Chen27-Jan-08 19:31 
GeneralRe: Uncaught exception Pin
George_George27-Jan-08 19:41
George_George27-Jan-08 19:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.