27. 구조체 배열과 화살표 연산자
다음 C 프로그램의 실행 결과를 쓰시오.
1#include <stdio.h>23struct Item {4char name[8];5int price;6int qty;7};89int main() {10struct Item list[3] = {11{"pen", 500, 4},12{"cup", 1200, 2},13{"bag", 3000, 1}14};15struct Item *p = list;16int total = 0;17for (int i = 0; i < 3; i++) {18total += (p + i)->price * (p + i)->qty;19}20p++;21p->qty += 3;22(*p).price -= 200;23printf("%d\n", total);24printf("%s %d\n", p->name, p->price * p->qty);25printf("%c %d\n", (p + 1)->name[0], list[1].qty);26return 0;27}