+ 1
Why can't we declare destructor as private?
why compiler giving error when destructor is declared as private?
1 Answer
+ 3
Because it's implicitly called outside the class when an objects memory is freed.
why compiler giving error when destructor is declared as private?