Question #5563

give an example of construction and destruction

Expert's answer

class myclass {
int val;
public:
myclass(int i) {
val=i;

cout<<"construction"<<endl;
}
~myclass()
cout<<"destruction"<<endl;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS