No I must use Point& else Its Firing wired Linker errors.
That is probably due to an inconsistency between your class declaration and its implementation.
Look at CornedBee's example. You could implement your post-increment operator++ as:
Code:
const Point Point::operator++(int)
{
Point temp(*this);
++*this;
return temp;
}
If it does not work, then either your copy constructor or pre-increment operator++ is incorrect.
What Argument would I use here what int ??
Anything if you are calling the operator by its name as a function, nothing if you are using it as an operator. For example:
Code:
// Assume pt is a Point object.
pt++; // Post-increment operator used as an operator.
pt.operator++(123); // Post-increment operator called by name as a function.
// Note that 123 is just an example, you can use any other int values too.
Note also that since it is post-increment (or postfix notation, if you prefer), your example usage will result in y being a copy of pt, and pt being post-incremented. As such, make sure that you are checking for the right thing.