Showing posts with label Coding Of Unary Operator Overloading. Show all posts
Showing posts with label Coding Of Unary Operator Overloading. Show all posts

Wednesday, 31 October 2012

Program Of Unary Operator Overloading In C++

#include<iostream.h>
#include<conio.h>
 
{
 
    private:
 
    int a;
 
    public:
  
  void getdata(int x)
 
    {
 
      a= x;   
 
    }
  
    {
 
    a++;
 
    }
 
    void display()
 
    {
     
 cout<<"\n a="<<a;   
 
    }
 
}
 
main()
 
{
 
clrscr();
 
box b1;
 
int x;
 
cout<<"Enter x=";
 
cin>>x;
 
++b1;
 
++b1;
 
++b1;
 
++b1;
 
getch();
 
}