I have a question, im making + operator for one of my classes, the code is this:
The question is: i have to make a new object so i can return it, however if i make an auto object it will be deleted after the function ends ( right ? ) and if i make it withCode:const Color & operator + ( const Color & a, const Color & b );
It wont be deleted after assignement... So how would i do it? i dont really want to pass the Color class entirely since it isnt small enough.Code:Color * color = new Color;
thanks![]()



LinkBack URL
About LinkBacks



