2011-10-19 8 views
2

これで何が起こっているのか分かりませんが、私がGoogleで見つけたのは、構造体の最後にセミコロンを忘れていることです私はそこに1つ持っている。構造体 - 宣言指定子の2つ以上のデータ型(私はセミコロンを持っています)

はここで列挙型は、あまりにも、セミコロンが必要

#include <stdio.h> 
#include <string.h> 

#define NAME_LENGTH 20 
#define BOOK_NAME_LEN 50 
#define AUTHOR_NAME_LEN 30 
enum bookStatus {CHECKED_IN, CHECKED_OUT, UNDER_REPAIR, LOST} 
enum patronStatus {ACTIVE, INACTIVE} 
struct Book{ 
     char title[BOOK_NAME_LEN]; 
     char author[AUTHOR_NAME_LEN]; 
     enum bookStatus status; 
}; 
struct Name{ 
     char first[NAME_LENGTH]; 
     char last[NAME_LENGTH]; 
}; 
struct Patron{ 
     int numBooksOut; 
     struct Name name; 
     struct Book books[50]; 
     enum patronStatus status; 
}; 
struct Collection{ 
     struct Book book; 
     char title[BOOK_NAME_LEN]; 
     char author[AUTHOR_NAME_LEN]; 
     int id, year; 
     enum bookStatus status; 
}; 
struct Library{ 
     int totalPatrons, totalBooks; 
     struct Patron patrons[50]; 
     struct Collection collection[50]; 
}; 

答えて

関連する問題