Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct DataNode
- {
- int id;
- } DataNode;
- typedef struct Node
- {
- DataNode data;
- struct Node *Next;
- } Node;
- typedef struct List
- {
- int size;
- Node *head;
- } List;
- List *CreateList ()
- {
- List *list = (List*) malloc(sizeof(List));
- list->size = 0;
- list->head = NULL;
- return list;
- }
- void Push (List *list, DataNode data01)
- {
- Node *node = (Node*) malloc (sizeof(Node));
- node->data = data01;
- node->Next = list->head;
- list->head = node;
- list->size++;
- }
Add Comment
Please, Sign In to add comment