c++ - Is using *this a good idea? -
I'm not sure
return * this
Is there a way we can return an example of a member who calls the party's function? I said that the reason is that our instructor told us to avoid using pointers if necessary and I am thinking that this is a case where this indicator is returning the only way to do it.
I am working with a fractional class which keeps personal data member portions and divisor. For example, I'm talking about member function, for example, to add two degrees:
fraction C = apples (b);
Plus member function is defined as:
fraction & amp; Plus (const fracture fract)
The instructor wants us to C = A + = B, so I think this is the reason.
Get a new trainer It seems that the plus () announcement is completely false
This member can be more likely to have a smarter sense of function The Anwyn Of course, it should probably be a friend.
Comments
Post a Comment