I have an class A which uses a heap memory allocation for one of its fields. Class A is instantiated and stored as a pointer field in another class (clas
If you have a usual pointer (A*) then the destructor will not be called (and memory for A instance will not be freed either) unless you do delete explicitly in B's destructor. If you want automatic destruction look at smart pointers like auto_ptr.