#include<iostream.h>
class KARAN
{
private: int k; public: KARAN():k(5) { } void operator ++() { k=k+1; } void Display() { cout<<"Value is: "<<k; }};
int main()
{
KARAN g; ++g; /* operator function void operator ++() is called */ g.Display(); return 0;}
No comments:
Post a Comment