One point about putting a 'naked' pointer into different kind of
containers, is that the pointer doesn't have a destructor to release the
referenced memory.
/Per W
On Tue, 28 Jan 2003, Ioannis Vranos wrote:
> -------Original Message-------
>
> From: Michael Stather
> Date: =C4=E5=F5=F4=DD=F1=E1, 27 =C9=E1=ED=EF=F5=DC=F1=E9=EF=F2 2003 6:09:=
30 =EC=EC
> To: dev...@li...
> Subject: [Dev-C++] STL::Vector
>
> Included with Dev-C++ are the STL classes, among which I found "vector".
> I need it to get a dynamic array in my program.
>
>
> =3D=3D> Good, and always use vector and standard containers instead of bu=
ilt in
> arrays.
>
>
>
> Now I read in a book that I shouldn=B4t put pointers in STL classes, but =
I
> don=B4t understand why.
>
>
> =3D=3D> Apparently the book is stupid. Bad advice. Probably it meant to a=
void
> using pointers whenever you can, but this is very different than to not u=
se
> vectors with pointers (in case you can't avoid pointers).
>
>
>
>
> Could someone please explain me why, an
|