Constructor in C++ Language (part -1)
Constructor in C++ Language
What is Constructor in C++ ?
constructor in C++ |
How to Call Constructor ?
Lets take first example of 'Constructor is implicitly invoked when an object is created' :--
Example - 1
constructor in c++ |
OUTPUT
Example - 2
OUTPUT
Here we seen in above example that how to create constructor i.e complex () {cout<<"Hello
constructor";} and how they call automatically with object i.e complex c1,c2,c3;
We will discuss ' Constructor is used to solve problem of initialization' in next lecture....
If you have any query then please comments in comment section or if this article is helpful to you
then please like share....
Comments
Post a Comment