i++
This returns the value of the i before it is incremented. So the idea is that if you want to use i in a function, and then increment the value after using it, you can do that in one step.
As an example, here is how I would overload that operator for integers.
Integer Integer::operator++()
{
Integer returnValue = *this;
this->increment();
return returnValue;
}
So it increments the value and then returns what it used to be. It also doesn't return a reference, because returning a reference would be different from what was originally passed, which would break cascading.
++i
This increments the value of i, and then returns the new value. So you could use this in a situation where you want to increment i and then use the new value in your function.
Integer Integer::operator++(Integer i)
{
i.increment();
return i;
}
So the value it returns is the incremented value of i.