c言語宿題です..
■ このスレッドは過去ログ倉庫に格納されています
0029リンクリスト 3/3
NGNG{
struct foo *f;
struct _node *current;
if(list==NULL)
return;
printf("===== struct foo =====\n");
current = list->first;
while(current){
f = current->data;
printf("foo : a = %d, b = %d, c = %d\n", f->a,f->b,f->c);
current = current->next;
}
}
struct _list *list_new()
{
struct _list *list;
if(list = malloc(sizeof(struct _list))){
list->first = NULL;
list->last = NULL;
}
return list;
}
void list_delete(struct _list *list)
{
struct _node *next;
struct _node *current;
if(list==NULL)
return;
current = list->first;
while(current){
next = current->next;
free(current);
current = next;
}
}
■ このスレッドは過去ログ倉庫に格納されています