C++ Object Initialization
Dynamic initialization of objects in c++
The dynamic initialization means that the initial values may be provided during run time. Even class objects can be initialized dynamically. I.e. with the values provided at run time. The following example explains it.
A Program to find the factorial of an integer using constructor.
Factorial (int number)
Void display ()
For (int i=1; i<=n; i++)
Void main ()
Cout<<”\n enter the number to find its factorial “;
- C++ Functions C++ Functions A function is meant for performing a specified...
- Switch Statement In C++ Switch statement in c++ C++ provides a multi way decision...
- Constructor in C++ Constructor in C++ Constructor is a member function with the...
- Loops in C++ Loops in C++ Loop is used when we want to...
- Class In C++ Class in c++ Class is a group of similar object....