/*
variables of type "struct Node" have two fields:
- pointer to next node
- some value
*/
struct Node {
struct Node *next;
long value;
};
/*
predecalre all nodes so that we in the initialization of a node we can point
to a node that gets defined later:
*/
extern struct Node a;
extern struct Node b;
extern struct Node c;
extern struct Node d;
/*
define all nodes as global variables:
*/
struct Node a = {
&c, // &c is the address of global variable b
'A'
};
struct Node b = {
&d, // &d is the address of global variable b
'B'
};
struct Node c = {
&b, // &b is the address of global variable b
'C'
};
struct Node d = {
&a, // &a is the address of global variable b
'D'
};