+ 1
C++: Why constructor cannot be virtual but destructor can?
constructor destructor in c++
1 Odpowiedź
+ 2
Because, constructor is not "invoked". It is called only once when an object is declared. So, a constructor cannot be made virtual in C++. Virtual destructors are important to prevent memory leaks, and monitor the system