mercredi 3 juin 2015

What all operators can be defined inside a struct in C++? [duplicate]

This question already has an answer here:

I actually cannot understand 3rd,4th line in the following code in C++ :

struct POINT {
      int x,y;
      POINT(int x = 0, int y = 0) : x(x), y(y) {}
      bool operator ==(POINT& a) {return a.x==x && a.y==y;}
};

Other examples/explanations are also welcome apart from this code snippet :)

Aucun commentaire:

Enregistrer un commentaire