I've know that a pointer to some dynamic memory must be deleted to prevent memory leaks.
Now if say a struct/array or some other data structure, each with its own dynamic memory parts. If that structure (class, file...etc) contains the data structure goes out of scope does that automatically free the memory pointed to by the pointers or does one still need to delete each one manually?