Thanks Worked
Code:
#include <iostream>
//using simple Overloading ON Simple Objects Without New
using namespace std;
class Point{
private:
int x, y;
public:
Point(){}//default Constructor
Point(int, int);//Constructor
Point(const Point&);//Copy Constructor
void desc(const char* txt){
cout<<"describing "<<txt<<endl;
cout<<"x = "<<this->x<<"\t"<<"y = "<<this->y<<endl;
}
Point& operator++();//The Operator Overloader Prototype
~Point(){cout<<"destructing"<<endl;}
};
Point::Point(int a, int b){
this->x = a;
this->y = b;
}
//operator Overloader function declearation
Point& Point::operator++(){
++x;
++y;
return *this;
}
int main(){
Point pt(4, 10);
pt.desc("pt");
return 0;
}