dimanche 7 juillet 2019

I cannot add two or more parameters the the bool operator in a class

When I try to add bool operator==(complx a, complx b) it says

  |Code      |Description
  |EO344     too many parameters for this operator function


I have tried using one parameter, but a can't do it

```

    //boolean operators                         "|Code  |Description
    bool operator==(complx a, complx b)//error: " EO344 too many parameters for this operator function"
    {
        /*error code*/return a.real() == b.real() && a.imag() == b.imag();
    }
};

It says there are too many parameters, but my book says there's not. Can you help me?



Aucun commentaire:

Enregistrer un commentaire