Learn basic concept of c , c++ and python programming in regularcodes.com

Spread the post

Constructor overloading

Multiple constructors are possible in c++. that means there are possible to overload constructors.

The following characteristics of constructor overloading

1) Same name of overloaded constructor. The difference are its parameter.
Example

2) Same number of arguments (parameters) are possible in constructor overloading . but there parameter data type will be different. note that its paramter sequanece are diffenent.

3) Possible to pass argument as object of constructors.

Program for overloaded constructors.

Output

Spread the post

Recommended Posts: