/* 3. ´ÙÀ½ ÇÁ·Î±×·¥ÀÇ Ãâ·ÂÀ» ½á¶ó. */ #include struct data { int x; int y; }; void add1(struct data a,struct data b, struct data c) { b.x = a.x + c.x; b.y = a.y + c.y; } void add2(struct data *a,struct data *b, struct data *c) { b->x = a->x + c->x; b->y = a->y + c->y; } main() { int number[5] = { 1, 2, 3, 4, 5 }; struct data a; struct data b; struct data c; a.x = number[0]; a.y = number[1]; b.x = number[2]; b.y = number[2]; c.x = number[3]; c.y = number[4]; add1(a,b,c); add2(&a,&b,&c); printf("%d %d %d %d %d %d\n",a.x,a.y,b.x,b.y,c.x,c.y); }