先是typedef
typedef struct {
char start;
char end;
int value;
int passed;
} info_t;
typedef info_t* data_t;
typedef struct node node_t;
struct node {
data_t data;
node_t *next;
}
typedef struct {
node_t *head;
node_t *foot;
} list_t;
list_t
make_empty_list(void) {
list_t *list;
list = (list_t)malloc(sizeof(*list));
assert(list!=NULL);
list->head = list->foot = NULL;
return list;
}
然后要写的function是把one_list 加到 all_list 之前,要分两种情况考虑到all_list是不是空
add_list(list_t *all_list, list_t*one_list) {