Abhijeet D Mhatre wrote:
I have a doubt in C++. when I pass an object to a function, the destructor gets called twice.
<snip>
<disclaimer> Haven't done C++ for ages now, so don't take my word for it. </disclaimer>
Use a copy constructor:
play(const play& copy_me) { i = copy_me.i; j = copy_me.j; }
-Manish