#include <stdio.h>
#include <stdlib.h>

struct list {
    int key;
    struct list *next;
};

struct list *append(struct list **l, int k)
{
    *l = malloc(sizeof *l);
    (*l)->key = k;
    return *l;
}

void print(struct list *node)
{
	while(node)
	{
		printf("%d\n", node->key);
		node = node->next;
	}
}

int main(void)
{
    struct list *l;
    struct list *head = l;
    int i;

    for (i = 0; i < 42; ++i)
            l = append(&l, i);	
    
    print(head);
}
