C++
CONSTRUCTORS IN C++
§ Contractor is a member function of a class.
§ The name of a constructor is the same as the name of the class.
§ It is no return type, so can’t use the return keyword.
§ It must be an instance member function that is it can never be static.
How to call a constructor?
§ Constructor is created, when an object is created.
§ Constructor is used to solving the problem of initialization.
Q. What will happen when we create more than two objects?
The constructor will called two times.
What is the problem of Initialization?
§ Why it is called constructor?
§ What is the problem of initialization?
§ How constructor resolves the issue?
**This article is under process**

Post a Comment
0 Comments