Sunday, 27 November 2011

C++ Program For (*) Multiply Operator Overloading


#include<iostream.h>
#include<conio.h>
class test
 {
  int num;
  public:
  void operator *(test ob)
   {
    int div;
div=num/ob.num;
cout<<"mul="<<mul;
   }
  test(int x)
   {
    num=x;
   }
 };
 void main()
 {
   test t1(20),t2(4);
   t1*t2;
   getch();
 }

No comments:

Post a Comment