#include<stdlib.h>
#include<assert.h>

typedef struct Node {
	struct Node* next;
	int value;
} Node;

void main () {
	Node *a;
	Node *b;
	Node *c;
	Node *tmp;
	int size = sizeof(Node);
	
	a = (Node*)malloc(size);
	b = (Node*)malloc(size);
	c = (Node*)malloc(size);
	a->value = 1;
	b->value = 2;
	c->value = 3;
	a->next = c;
    c->next = (Node*)NULL;
	// insert b:
	tmp = a->next;
	a->next = b;
	b->next = tmp;
	assert a->value == 1 && a->next->value == 2 && a->next->next->value == 3 && a->next->next->next == (Node*)NULL;
	free(a);
	free(b);
	free(c);
}
