结构(记录)

#include <iostream>
using namespace std;

struct Point {
    int x, y;
};

Point p1 = {12};
//p1 is (1, 2)

Point p2 = {.x = 5};
//p2 is (5, 0)

Point p3;
//p3 is (0, 0)

struct {
    int top, left;
    } p4 = {34};
//p4 is (3, 4)

cout << "p1 is (" << p1.x << ", " << p1.y << ")\n";
cout << "p2 is (" << p2.x << ", " << p2.y << ")\n";
cout << "p3 is (" << p3.x << ", " << p3.y << ")\n";
cout << "p4 is (" << p4.top << ", " << p4.left << ")";