ファイル名=  exercise/chapter21/pass21-3.c
#include 

#include

typedef struct {
char title[100];
char author[100];
int year;
int price;
_Bool ebook;
} book ;

#define SIZE 3

int main(void)
{
FILE *in = fopen("../pass21-2/book.dat", "r");
FILE *out = fopen("bookarray.dat", "w");
if(in==NULL || out==NULL){
fprintf(stderr, "★ファイルを開けません");
exit(EXIT_FAILURE);
}

book bk[3];
for(int i=0; i
fread(&bk[i], sizeof(book), 1, in);
}
fwrite(bk, sizeof(bk),1, out);


fclose(in);
fclose(out);
return 0;
}