how much does the default destructor do
Does the default destructor in C++ classes automatically delete members that are not explicitly allocated in code? For example: class C { public: C() {} int arr[100]; }; int main(void) { C* myC = new C(); delete myC; return 0; } Does delete myC deallocate myC's arr automatically? Or do I need to write C's destructor to do this explicitly? The constructor (in the absence of any ctor-initializer-list ) calls the default constructor for each subobject. Since you have no base classes and your member variables are primitive types, it will do nothing at all. Same with the destructor. Yours is