 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you the use of constructor overloading in C++. Before starting, you can note my information. You can connect with me by following these details. You can download my app, tag image based on programming available on Google Play. You can search my channel on YouTube by typing my name Sanjay Gupta. You can open this channel. Here you can subscribe my channel where various programming related videos and playlists are available. You can improve your programming skills by watching these videos. Now coming on to the topic. I will be demonstrating use of constructor overloading. So comment is available here. Then header file IO stream is included. STD namespace is used, which is predefined. Then class name is complex. It is having two attributes R and I. Then in public section, three constructors are defined default single parameterize and double parameterize. You can see all constructors are sharing same name. This is the property of constructor that we have to define constructors with name of the class. So each class having a single name. So if we are defining three constructors, so name of constructors will be same. This is the property of constructor, but arguments are different. So I hope you know the concept of function overloading where function overloading where function overloading says that we can define more than one functions with same name, but their arguments should be different according to their type or numbers. So here you can see name of these constructors are same, but first constructors having zero argument, second is having one argument and third is having two arguments. So these are valid constructor definitions. So first will assign 15 and 10 into R and I second will assign a into R and 10 into I and third will assign a into R and B into I. So this way I have implemented three constructors properly in this class. Then read and print functions are defined. These are simple definitions. Read is reading R and I and print is printing value of R and I on console. Then you have to notice main function here C1 and C2 will call default constructor and this C3 and C4 these will be calling parameterized constructors. So C3 will call single parameter constructor and C4 will call double parameterized constructor and then all the objects are calling print function to display the values. So this way you can implement constructor overloading in C++. So I am repeating again in C++ class we can define more than one constructors. Each constructor will be having a name of the constructor as name of class as name of classes same for all the constructors. So you have to pass different number of arguments or different type of arguments. If we do so then you can implement more than one constructors in a class. Now I am executing this code. You can see the output C1 and C2 are printing 15 10 C3 is printing 5 10 and C4 is printing 30 and 40. So if you want to assign same values to multiple objects then you can prefer default constructor. If you assign different values to different objects then you can prefer single parameterized or double parameterized constructor. So this is all about constructor overloading. It is similar to function overloading that is available in C++. If you want to watch more programming related videos you can visit my channel on YouTube where various programming related videos and playlists are available. Thank you for watching this video.