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

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

void main () {
	Node *a;
	Node *b;
	Node *c;
	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 = b;
	b->next = c;
	c->next = (Node*)NULL;
	
	// delete b:
	a->next = c;
	free(b);
	assert a->value == 1 && a->next->value == 3 && a->next->next == (Node*)NULL;
	free(a);
	free(c);
}
