Mail Archives: djgpp/1999/02/27/23:21:59
At 10:36 AM 2/27/99 GMT, you wrote:
> vector<string> words;
The vector deals with its own destruction. you would only need a
delete [] words
if you had used your own dynamic allocation, with
string *words;
...
(in constructor)
words = new string[some_number];
As it is you don't need any destructor in that class since you don't have
any dynamically allocated pointer members. (The vector's destructor deals
with that and is called automatically.)
Also, you almost never need to explicitly call a destructor.
--
.*. "Clouds are not spheres, mountains are not cones, coastlines are not
-() < circles, and bark is not smooth, nor does lightning travel in a
`*' straight line." -------------------------------------------------
-- B. Mandelbrot |http://surf.to/pgd.net
_____________________ ____|________ Paul Derbyshire pderbysh AT usa DOT net
Programmer & Humanist|ICQ: 10423848|
- Raw text -