so basically this is what I am doing:
myClass a,b,c;
a = myClass( ... );
b = myClass( ... );
c = a+b;
this is simple enough, but now I have to overload the operator...
myClass myClass::operator+ (myClass f)
{
myClass temp;
temp.value1 = value1*f.value1;
temp.value2 = value2*f.value2;
temp.value3 = value3*f.value3;
return temp;
}
I know I can access the fields directly by dotting into them, but what if I want to refer to the whole datatype, I can easily say temp or f for two of them, but I need to refer to the 3rd one. How do I do that? I know in java I would say "this" what would be the equivalent?
In other words when I run this program:
c=a +b I can easily refer to b as f while i am in the function. How do I refer to a?