the problem with operator is, that although it is working when called by using "+" the object "nowy" is still empty after operation. operator+ returns a new object of my class widmok. This object has desired values on each kanal[] in the operator body, but newObj initialized with it is still empty. Is sth wrong with returning here?
That's because you've defined a copy constructor that does nothing.
You should either remove it or define it to do copy the class members. The copy constructor is used in widmok::operator+(int) to copy local object rezultat out.
Thank you very much.
@kbw: yes, of course, how could i forget! ; ) it was copy constructor who destroyed the work operator+ did.
@Mathes: regarding this above it is strange that you get right result. and sorry, i was obviously talking about newObj, i've had to change language of my code(names of variables). and yes, 11 is all i wanted to see.