aboutsummaryrefslogtreecommitdiff
path: root/testbed/custom_struct.c
blob: 0d473f52f7fab7a6e13fb0d9b9458e5e5e4a5d0f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
struct D {
    int a, b;
};
struct A {
    int a[100];
    struct B {
        struct C {
            int x, y;
        } c;
        int z;
        struct D *p;
    } b;
} s;
int main() {
    struct D d;
    int n = 0;
    s.a[1] = 1;
    s.a[2] = 2;
    s.b.z = 4;
    s.b.c.x = 5;
    s.b.c.y = 6;
    s.b.p = &d;
    s.b.p->a = 7;
    s.b.p->b = 8;
    printf("%d %d %d %d %d %d %d\n", s.a[1], s.a[2], s.b.z, s.b.c.x, s.b.c.y, s.b.p->a, s.b.p->b);
}