#include <stdlib.h>
typedef struct node {
int val;
struct node * next;
} node_t;
node_t * createHead() {
node_t * head = NULL;
head = malloc(sizeof(node_t));
head->val = 0;
head->next = NULL;
return head;
}
node_t * addNode(node_t * current, int value) {
current->next = malloc(sizeof(node_t));
current->next->val = value;
current->next->next = NULL;
return current->next;
}
int main(int argc, char** argv) {
node_t * head = createHead();
addNode(head, 2);
printf("%d", head->next->val);
}