The above line of code is equivalent to if(i.getSize()!=0 && j.getSize()!=0){ but then later you say this line "The idea is to sort "spheres" according to their radius and the a dimension if the radius are the same."
Above line of code is not doing checking for "radius are the same" logic.
Sorry I didn't know getSize() is implemented as a boolean. The name indicate it is some long or int or float isn't it ? Just like jsmith I am wondering why is radius a boolean? I miss out something?
What do your copy constructor and assignment operator look like for Sphere, and why on earth is radius a boolean????
That was it. The copy constructor. Sorry not my code. Don't know why it is implemented like this. In the copy constructor everything BUT the boolean was copied.. When I changed this everything worked...
Sorry I didn't know getSize() is implemented as a boolean. The name indicate it is some long or int or float isn't it ? Just like jsmith I am wondering why is radius a boolean? I miss out something?
No you didn't. Bad code is bad.
Thanks for the help guys. Appreciated.
Bottomline : Always check your copy contructors and assignment operators.