Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Destructors

A C++ object is destroyed either at the end of program execution (for extern and static objects), at the exit from the closing brace of a scope (for automatic objects), when the operator delete is executed (for dynamic objects allocated with new), or when the library function free() is called (for objects allocated with malloc()).

Whenever a class object is destroyed (with the exception of the call to free()), the class destructor is called immediately before the destruction; if the class defines no destructor, the system-supplied default destructor is called (similar to default constructor, it does nothing).


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint