|
From: Ioannis V. <no...@ho...> - 2003-01-27 23:55:33
|
-------Original Message-------=0D =0D From: Michael Stather=0D 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=0D To: dev...@li...=0D Subject: [Dev-C++] STL::Vector=0D =0D Included with Dev-C++ are the STL classes, among which I found "vector".=0D I need it to get a dynamic array in my program.=0D =0D =0D =3D=3D> Good, and always use vector and standard containers instead of bu= ilt in arrays.=0D =0D =0D =0D Now I read in a book that I shouldn=B4t put pointers in STL classes, but = I don=B4t understand why.=0D =0D =0D =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).=0D =0D =0D =0D =0D Could someone please explain me why, and whether there are other possibilities to creae a dynamic array of pointers?=0D =0D =0D =3D=3D> There are other standard library containers too, but since you wa= nt an=20 array of pointers" vector is the best choice.=0D =0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |