The following code is subject to the MIT license.
If the program is out of control and you are in trouble, press <Ctrl-C> to stop it.
Build a (doubly) linked list
/*
For the sake of brevity, error handling
has been omitted from the following code.
Please see the remarks below for more information.
*/

# include <stdlib.h>
// to call fn. malloc and fn. free

struct abc {
struct abc *l,*r;
} typedef abc_t;

abc_t *a,*b,*c;

a = 0;
c = 0;
// initialise them only once the first time.

b = (abc_t*) malloc(sizeof(*b));
if(!c) a = b;
else (*c).l = b;
(*b).r = c;
c = b;
(*c).l = 0;

// Remarks:
// Remember to call the free() function
// to release the memory buffer allocated by the malloc() function
// before terminating the program.