Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class A
- {
- private:
- {
- int a;
- int b;
- }
- public:
- A(int n) {
- a = n;
- }
- {
- A& operator++(); // префикс
- A operator++(int); // постфикс
- A& A::operator++() {
- ++a
- return *this;
- }
- A A::operator++(int) {
- A temp(a);
- ++(*this);
- return temp;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement