typedef struct
{

int mem;
struct node *next;

}NODE;


This is a typedef of an anonymous structure. I would avoid anonymous structures in general... but...