Computer Science, asked by Anonymous, 1 year ago

concept of constructor and destructor

Answers

Answered by ujjwal00086
4
construction means making distruction means destorying something
hope it helps

ujjwal00086: think before you act
Anonymous: hey dnt wry....its was a kinda joke
Anonymous: Okk sorry for i hurt uh.
ujjwal00086: its okay but don't do that again
Anonymous: OHH OHH ...
ujjwal00086: what do you mean by OHH OHH
Anonymous: kinda reaction to ua dnt do dat again
ujjwal00086: what to not do again
Anonymous: to not tok vdh uh again!!!
ujjwal00086: okay
Answered by siddhartharao77
6

Short note on constructor and destructor in c++:

(i) Constructors are invoked automatically when the objects are created.

(ii) Destructors are invoked automatically when the objects are destroyed.



(i) Constructors accept arguments.

(ii) Destructors does not accept arguments.



(i) constructor can be overloaded.

(ii) Destructors cannot be overloaded.


(i) Constructors has same name as class itself.

(ii) Desturctors also has but they should be prefixed with ~ symbol.



Hope this helps!


Anonymous: nycc...thanks a lot
siddhartharao77: welcome!
Anonymous: Yes
Similar questions