| book-write-prog.c - Programmet der udskriver bøger på en output fil. | Lektion 10 - slide 23 : 28 Program 1 |
#include <stdio.h>
#include "book-read-write.h"
int main(void) {
book *b1, *b2;
FILE *output_file;
b1 = make_book("C by Dissection", "Kelly and Pohl",
"Addison Wesley", 2002, 1);
b2 = make_book("The C Programming Language",
"Kernighhan and Ritchie",
"Prentice Hall", 1988, 1);
output_file = fopen("books.dat", "w");
print_book(b1, output_file);
print_book(b2, output_file);
fclose(output_file);
return 0;
}