+5

Can a class in c++ have multiple destructors?

c++

4/10/2019 6:55:48 PM

Narendra Kumar

4 Answers

New Answer

+8

No. Each class has only one destructor.

+7

Multiple constructors - yes; Multiple parents - unfortunately yes; Multiple destructors - no.

+6

No , The class can has a many constructors , but only one destructor ; cause there is no meaning to a class has a many destrucors

+5

No, what would you like to do with it ? https://www.geeksforgeeks.org/destructors-c/ Can there be more than one destructor in a class? No, there can only one destructor in a class with classname preceded by ~, no parameters and no return type.