Today my friend asked me, why really do we need constructors in C++?
Where as we can do the same in structural language.
What is the specialty of constructors, show me the need of constructors so that I should use it in my C++ program.
Please help me and give me some examples so that I could able to clear his doubt.
Today my friend asked me, why really do we need constructors in C++? Where
Share
You don’t need constructors in the same sense that you don’t need most features of popular languages.
Constructors exist to make it more difficult to do The Wrong Thing. In this case, using data that hasn’t been initialized.