#include <stdio.h>
#include <stdlib.h>

/* declaration of node type */

typedef struct node_s {
	int data;
	struct node_s * next;
} node_t;

/* declaration of list type */

typedef struct list_s {
	node_t * head, * tail;
} list_t;

int main(void) {
	/* creating a list */
	list_t * myList = (list_t *) malloc(sizeof(list_t));
	myList->head = myList->tail = NULL;

	/* appending to a list */
	node_t * node = (node_t *) malloc(sizeof(node_t));
	node->data = 0;
	node->next = NULL;
	myList->tail->next = node;

	/* printing a list */
	for (node = myList->head; node != NULL; node = node->next) {
		printf("%d\n", node->data);
	}
	return 0;
}

