Professional Documents
Culture Documents
Struct Float Int Char
Struct Float Int Char
h>
#include<malloc.h>
#include<string.h>
struct Food {
float quantity;
int expireYear;
char* name;
};
struct node {
node*next;
node* prev;
Food info;
};
return t;
}
return newNode;
}
struct DoubleLinkedList {
node* first;
node* last;
};
void main() {
DoubleLinkedList dl;
dl.first = NULL;
dl.last = NULL;
dl = insertBegin(dl, initFood("Orange", 2019, 2));
dl = insertBegin(dl, initFood("Banana", 2020, 3));
dl = insertBegin(dl, initFood("Apple", 2021, 4));
printList(dl);
deleteList(dl);
}