class integer 
{                                                                        
   public:
integer(int,int)// constructor declared
void display()
{
cout << "m=" << m << endl;
cout << "n=" << n << endl;
}
};
integer :: integer (int x, int y)   // constructor defined
   {
     m=x;
     n=y;  
   }
int main()
  {
    integer int1(0, 100);
    integer int2 = integer(25, 75);
   cout << "OBJECT1=" << endl;
int1.display();
cout << "OBJECT2=" << endl;
int2.display();
return 0;
}
Click here to go back.

Our aim is to provide information to the knowledge seekers.


comments powered by Disqus


Footer1