What is the interpretation of the output of the following code?


25th Feb 2022, 5:02 PM
محمد الشاوش
محمد الشاوش - avatar
3 Answers
+ 3
~Cpp() is destructor Cpp() and Cpp(string n) are construsctors Destructors happen when you delete an object Constructors are ways you can make an object
25th Feb 2022, 5:11 PM
Raul Ramirez
Raul Ramirez - avatar
+ 2
here u created three constructors which name is Cpp and constructor will execute while object creation so first your default constructor will be call then u have written one parameterized constructor and u haven't called anywhere that's why it won't be printed on the screen after that's destructor will be executed.
25th Feb 2022, 5:13 PM
AS Raghuvanshi
AS Raghuvanshi - avatar