본문 바로가기

정규 강의/Object-Oriented Data Structures in C++

C++ Class Destructors

Source: https://www.geeksforgeeks.org/destructors-c/

 

Definition

 

Destructor is a member function which destructs or deletes an object.

 

Description

 

A destructor function is called automatically when:

 

the function ends

the program ends

a block ends

(if the object is on the heap) a delete operator is called

 

A destructor should never be called directly.

 

'정규 강의 > Object-Oriented Data Structures in C++' 카테고리의 다른 글

C++ Copy Assignment Operator  (0) 2019.10.03
C++ Copy Constructor  (0) 2019.10.03
C++ Pointers  (0) 2019.10.01
1.2 C++ Classes  (0) 2019.09.26