All pastes #898549 Raw Edit

zad2.cpp

public text v1 · immutable
·published 2008-02-10 12:37 UTC
rendered paste body
#include <iostream>

using namespace std;

// klasa a
class a{
      public:
             int wart;
             void operator++(int x) { wart+=10;}
             
             a() { wart=0; }
             a(int x) { wart=x; }
};

// test operatora 
int main() {
    
    a obj1(5);
    
    for(int i=0; i<5; i++) {
             obj1++;
             cout << obj1.wart << endl;
             }
             
    system("PAUSE");
    
    return 0;
    }