The problem is to implement class Cplx
with two doubles x
and y
represent real and imaginary part of complex numbers.
One of the subtask is to implement operator ->
with following description:
(z->re
and z->im
): access to the real and imaginary part of z
(You must implement changing like z->re = 5
).
I have troubles with operator ->
I never really understand how it works so my question is: how ->
works and when to use it and how to apply that idea in this problem.