#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 = NULL;
    int i;

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