Object-Oriented Programming in C++: Constructors

Submitted by PhoeniciansSy on

Contents:

1. Constructors. 2. Default Constructors. 3. Constructors with Arguments. 4. Time Class with Constructors.

Constructors:

Constructor is a member function in the class, which has the following characteristics: 1. It has the same name as the class. 2. It doesn't return any type. 3. It is called every time an instance of a class is created. 3.

Object-Oriented Programming In C++: Overloading and Default Arguments

Submitted by PhoeniciansSy on

Content:

1. Function overloading in C++. 2. Default arguments in c++.

Function Overloading in C++:

We can have multiple definitions for the same function name in the same scope. The definition of the function must differ from each other by the types and/or the number of arguments in the argument list. We can not overload function declarations that differ only by return type. Example: We can define a function called display to print a integer number.