I have a class written, and i need to overload the operator + for it, so it just sums everything up really.
So i need:Code:Folder f1; f1.add_entry("name","post"); // f1.name[0] = "name" // f1.post[0] = "post" //both arrays have more space Folder f2; f2.add_entry("name2","post2"); // f2.name[0] = "name2" // f2.post[0] = "post2" //both arrays have more space. Folder f3;
So f3 then contains all the info from f1 and f2.Code:f3 = f1 + f2;
How do i write that function, i'm lost with unary operator overloading...
BTW, the variables in the classes are mostly strings with a bool and a double in there.



LinkBack URL
About LinkBacks


