Subj : vectors To : borland.public.cpp.borlandcpp From : mike Date : Tue Jul 27 2004 07:38 pm hi, i wanted to know the correct way to implement this. i have a class that parses a file and stores the result in a vector. i have a public function to get the vector, but i don't know how to return it properly. class A { public: vector& getPeople (); private: vectorpeople_; } the getPeople() just returns people_, however i wanted to know if this was correct. if i return a reference to people_ it is much less overhead then returning the entire vector. however when the A object is deleted (when i create it i do A *a = new A ()), is the memory deallocated? if so, it's probably just coincidence that my program works. i guess the only other alternative is to return a copy of the entire vector? Aloha, mike .