#include<iostream.h> #include<conio.h> class x { private: int a; public: x(int j) { a=j; } x operator++(int) //postfix { return(a++); } void display() { cout<<a; } }; int main() { x o1(10); cout<<"Before increment :"; o1.display(); o1++; cout<<endl; cout<<"After increment :"; o1.display(); getch(); return 0; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)