Overloading prefix inc. & dec. operators
why do you need to return *this at the next code sample:
// If our number is already at 9, wrap around to 0
if (m_nDigit == 9)
m_nDigit = 0;
// otherwise just increment to next number
That's how the operator is supposed to behave. You wouldn't be able to use it in an expression if didn't do that.
Topic archived. No new replies allowed.