Структуры (записи)

#include <iostream>
using namespace std;

struct Point {
    int x, y;

    Point() { }

    Point(int x, int y) {
        this->x = x;
        this->y = y;
    }
};

Point p1 = Point(12);
//p1.x is 1 and p1.y is 2

Point *p2 = new Point();
//p2->x is 0 and p2->y is 0

cout << "p1 is (" << p1.x << ", " << p1.y << ")\n";
cout << "p2 is (" << p2->x << ", " << p2->y << ")";