what i need is what is this "operator *" doin
why do i need "const"... and ""razlomak&r"
and how can i use "r." when i have "razlomak=ra" on top is it because of "razlomak&r"?
operator *
This indicates which operator is being overloaded.
const razlomak&r
This is a constant reference to a razlomak instantiation. The associated const qualifier indicates that the referenced object cannot be altered.
return razlomak (r.brojnik*brojnik, r.nazivnik*nazivnik);
This statement is creating a new instantiation of razlomak. During the declaration, two arguments are passed to the constructor of the object. These arguments are as follows:
Argument 1: The product of the r.brojnik*brojnik computation.
Argument 2: The product of the r.nazivnik*nazivnik computation.
Goran Gagro wrote:
how can i use "r." when i have "razlomak=ra" on top is it because of "razlomak&r"? (sic)