aboutsummaryrefslogblamecommitdiff
path: root/testbed/custom_struct3.c
blob: d7060b3a3fccf3a279ef8818e51a71271ddba2a6 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                          
struct A {
    int x, y;
} a[10];
struct A f(struct A a) {
    a.x++;
    a.y++;
    return a;
}
int main(){
    int i;
    for (i = 1; i < 10; i++)
        a[i] = f(a[i - 1]);
    for (i = 0; i < 10; i++)
        printf("%d %d\n", a[i].x, a[i].y);
}