Doubt

class A { int i; public: A(int ii) { i = ii; }
A(const A& a) { i = a.i; i++; } A& operator=(const A& a) { i = a.i; i--; } }; int main(void) { A a(4); A b = a; return 0; }

Referring to the above sample code, what is the value of b.i just before the return statement in main or is it undefined?
Nothing undefined about it.

http://ideone.com/0J9qvS
You should use a debugger. Step through the code and you can look at the value of b.i.
Topic archived. No new replies allowed.