Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
#include
using namespace std; class Point { public: int x, y; Point(int x, int y) { this->x = x; this->y = y; } bool operator==(Point other) { return x == other.x && y == other.y; } }; int main() { Point p1(1, 2); Point p2(1, 2); if (p1 == p2) { cout << "The points are equal"; } else { cout << "The points are not equal"; } return 0; }
The points are equal