hi..i am very beginner with c structure and i don't how to deal with complex struct as follow
Code:
typedef struct saleStruct
{
struct tm date;
int quantity;
float price;
struct saleStruct* next;
} SaleType;
typedef struct bookStruct
{
int id;
char title[TITLE_LEN + 1];
char author[AUTHOR_LEN + 1];
int year;
float price;
int count;
SaleType* head;
struct bookStruct* next;
} BookType;
typedef struct bookListStruct
{
BookType* head;
int count;
} BookListType;
Code:
/* can i do like this?? */
BookType *head = NULL, *current, *previous;
how do i need to access through BookType id using
BookListType *booklist , i had try using "booklist->BookType"
but fail or maybe wrong..can gave some tips..Thanks...