• 코드:
​x
 
1
#include <iostream>
2
using namespace std;
3
​
4
struct Book
5
{
6
    string title;
7
    string author;
8
    int price;
9
};
10
​
11
void Display(const Book&);
12
​
13
int main(void)
14
{
15
    Book web_book = {"HTML과 CSS", "홍길동", 28000};
16
    Display(web_book);
17
    return 0;
18
}
19
​
20
void Display(const Book& bk)
21
{
22
    cout << "책의 제목은 " << bk.title << "이고, ";
23
    cout << "저자는 " << bk.author << "이며, ";
24
    cout << "가격은 " << bk.price << "원입니다.";
25
}
표준입력 & 실행옵션