✅ 목표 (Goal)
✅ 목차 (Index)
✅ 책을 한권 만들어 보자.
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
struct book_t {
char title[128];
char author[128];
int price;
};
int main(void) {
static int count = 0;
struct book_t book; // 책 한권 만들기..
strcpy(book.title, "야옹이 수영교실");
strcpy(book.author, "신현경");
book.price = 14220;
printf("[%d] %s / %s / \\\\%d\\r\\n", ++count, book.title, book.author, book.price);
return 0;
}
✅ 책을 여러권 만들어 보자.
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
struct book_t {
char title[128];
char author[128];
int price;
};
int main(void) {
int count = 0;
struct book_t book1; // 책 한권 만들기..
strcpy(book1.title, "야옹이 수영교실");
strcpy(book1.author, "신현경");
book1.price = 14220;
printf("[%d] %s / %s / \\\\%d\\r\\n", ++count, book1.title, book1.author, book1.price);
struct book_t book2; // 또 만들고..
strcpy(book2.title, "천개산 패밀리 1");
strcpy(book2.author, "박현숙");
book2.price = 12600;
printf("[%d] %s / %s / \\\\%d\\r\\n", ++count, book2.title, book2.author, book2.price);
// 또 만듦, 도합 3권 만들기..
struct book_t book3 = { "세상은 이야기로 만들어졌다", "자미라 엘 우아실", 24300 };
printf("[%d] %s / %s / \\\\%d\\r\\n", ++count, book3.title, book3.author, book3.price);
return 0;
}
