Networking, Programming and Graphics Tutorials

Multiple Constructors in a class - C++ [1/1]

Type:
Multiple Constructors in a class - C++
Level: Intermediate Networking, Programming and Graphics Tutorials Networking, Programming and Graphics Tutorials 
Multiple Constructors in a class - C++
Date: 2006-Dec-08
Multiple Constructors in a class - C++
Visited: 2062 times
Multiple Constructors in a class - C++
Rating: Multiple Constructors in a class - C++
Multiple Constructors in a class - C++
Author: Alex Plumpton

It is possible to define more than one constructor function in a class. This is known as constructor overloading. The class definition shown in the figure declares three constructors for an integer object.

Multiple Constructors in a class - C++
The first constructor receives no arguments, the seconds receives two integer arguments and the third receives one integer object as argument. The declaration shown in the figure, automatically invokes the first constructor.

Multiple Constructors in a class - C++
Rate this tutorial:                    
Networking, Programming and Graphics Tutorials - Multiple Constructors in a class - C++ [1/1] - Networking, Programming and Graphics Tutorials

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: multiple constructors in a class  multiple constructors in c++  multiple constructors C++  "C++" "multiple constructors"  C++ multiple constructors  multiple c++ constructors  multiple Constructors in c++  constructors in c++  what are parameterized constructors?  characteristics of constructors in c++  parameterized constructors in c++  parameterized constructors in C++  characteristics of constructors  parametrised constructors in c++  parameterized constructors  parameterized Constructors in c++  parameterized constructors c++  constructors in multilevel inheritance + c++  parameterized constructors +inheritance c++  parameterized constructors in multilevel inheritance in c++