mardi 28 mars 2023

Question's accepted Answer is wrong . . .Answer should be revised for future reference

Here the answer is accepted but this is wrong answer. The statement is not correct. The number of explicit parameters a member function takes depends on the number of arguments required by the function.

Answer should be: Since the left-hand operand of this operator* (const float &m, const vector &v) is a float and not a vector object, it cannot be a member function of the Vector class. Therefore, this function is implemented as a non-member function outside the Complex class/or say friend function. Same goes to the const vector vector::operator* (const vector &v, const float &m) with difference now float at right-hand. Kindly verify . .

Aucun commentaire:

Enregistrer un commentaire