Mail Archives: djgpp/1998/07/17/21:01:49
Michael Tanczos wrote:
> When are deconstructors called when using classes? At the
> end of the program if it's declared statically.. or when
> you delete the object if it's declared dynamically? Or do
> you need to call the deconstructor directly..
Automatic (local) objects are deconstructed when they go out of scope.
(When you leave the block to which they belong.) Dynamic objects
(allocated with new) are deconstructed when you use the operator delete
on them.
You should not be attempting to explicitly call a destructor unless you
are doing something very, very strange.
--
Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com
Alcyone Systems / http://www.alcyone.com/max/
San Jose, California, United States / icbm:+37.20.07/-121.53.38
\
I put away my nine, fool / 'cause I'm colorblind.
/ Ice Cube
- Raw text -