C++: what happens when you delete a pointer to an object of a class without explicit destructor? -


what happens when delete pointer object of class not have declared destructor?

every class (or struct) has destructor (unless pod. if not declare 1 compiler add implicit destructor. take following class example:

struct {     std::string test; }; 

no destructor defined a. yet has one, because compiler automatically adds it. isn't empty. call destructor of test, because std::string has destructor itself.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -