Header file book_info struct
struct book_info {
char title[50];
char author[40];
unsigned int year_published;
};
typedef book_info;
book_info books[20];
void init_heap() {
head = 0;
for(int i = 0; i < 19; i++) {
books[i].year_published = i+1;
}
books[20].year_published = 10000;
}
Trying to make an array of book_info structs, and then assign the year published of each struct to a number when initializing. Not sure exactly what the problem is?
typedef book_info;??books[20].year_publishedaccesses out of bounds. The valid indices are0through19.