Logo 
Search:

C++ Programming Articles

Submit Article
Home » Articles » C++ Programming » Object Oriented ProgrammingRSS Feeds

Program of constructor overloading

Posted By: Amelie Hughes     Category: C++ Programming     Views: 21487

Write a program of constructor overloading.

Code for Program of constructor overloading in C++ Programming

#include<iostream.h>
#include<conio.h>
class o1
{
    public:
    o1()
    {
        cout<<"Hello"<<endl;
    }
    o1(int j)
    {
        for(int k=0;k<j;k++)
            cout<<k<<endl;
    }
};

main()
{
    clrscr();
    o1 l1;
    o1 l2(5);
}
  
Share: 


Didn't find what you were looking for? Find more on Program of constructor overloading Or get search suggestion and latest updates.

Amelie Hughes
Amelie Hughes author of Program of constructor overloading is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!