Q: How do I overload the postfix increment and decrement operators? (as in x++ or x--)?
A: To specify the postfix increment and decrement operators, you must specify an int as an argument:
FAQ contributed by: [Kevin Hall]Code:class MyClass { public: MyClass& operator++(); //Prefix increment operator (++x) MyClass operator++(int); //Postfix increment operator (x++) MyClass& operator--(); //Prefix decrement operator (--x) MyClass operator--(int); //Postfix decrement operator (x--) };