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

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -