0
PLEASE HELP i got Error !!!
When i created program for Destructor I got errors as shown in the code https://code.sololearn.com/cqEiPnL7z5FH/?ref=app
4 Réponses
+ 4
You have a semicolon ; after destructor declaration. Remove that and enclose associated statement in { }
alternatively , you can also define it outside class and keep declaration in class.
my::~my(){
cout<<count<<"Object Destroyed";
count -- ;
}
//use this outside class.
Next thing, You need to define the static variables outside class that you declare inside class.
int my::count = 0;
//use this outside class.
You can refer this code:
https://code.sololearn.com/ckvqxZPZi108/?ref=app
+ 1
Ok Omkar Bro
Thank You very Much for detailed Explanation 😊
0
Hi. you forgot curly braces {}. Just compare with constructor definition
0
Ok Russian bro
I doesn't Understand your name but thank you