The copy constructor is only being called once in this program.. and probably unintentionally?
http://www.fredosaurus.com/notes-cpp/oop-condestructors/copyconstructors.html
The default value in your constructor definition may cause some confusion too, I'd recommend moving it into your class declaration.
What do you mean with "different result"? does it behave differently, or is something else different (like the exectuable size)? The standard guarantees that the same statements lead to the same behavior defined by the standard - it doesn't say how exactly the compiler has to accomplish this.
Without overloading the assignment operator, this is what you are doing:-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
int *a, *b, *c;
a = newint(0);
b = newint(0);
c = newint(0);
a = b;
b = c;
c = a;
// a and c point to the same location, the memory originally allocated for a is lost.
delete a;
delete b;
delete c; // bigbadaboom
may the error is in my system ill try re installing my os...coz last time i had this experience three compilers have different result, but that was unary operation..