* Lilith:
I'm working on a class that contains a pointer to a different class
object that behaves as a linked list. What I'm not sure of is, if I
do a delete on the pointer to the object of the second class, will the
destructor of the second class be [executed]? Or do I need to delete
any downstream pointers manually?
When you delete a pointer, the pointed to object is destroyed, and when
an object of class type is destroyed, its destructor is executed.
However, instead of doing list management using raw pointers, consider
using std::list.
And if you must use pointers, for some reason, consider packing them in
smart pointer objects such as std::auto_ptr or (probably best for your
needs, because std::auto_ptr is tricky) boost::shared_ptr -- the
latter is part of the Boost library, at <url: http://www.boost.org/>.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?