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

python - Installing PyDev in eclipse is failed -

PHP OOP-based login system -

c# - Nested Internal Class with Readonly Hashtable throws Null ref exception.. on assignment -