#include 
#include 
struct node {
   struct node* pNext;  // pointer to next node in dynamically allocated list
   int data;            // data carried by this item
};
 
int main() {
    // static allocation of single structure (stack)
    struct node myNode;
    myNode.data = 123;
    myNode.pNext = NULL;
 
    // dynamic allocation of single structure (heap)
    struct node* pMyNode = malloc(sizeof(struct node));
    (*pMyNode).data = 123;
    (*pMyNode).pNext = NULL;
    // alternative access via -> operator
    pMyNode->data = 123;
    pMyNode->pNext = NULL;
 
    // allocate second additional structure and connect with previous one
    pMyNode->pNext = malloc(sizeof(struct node));
    // fill second structure with first one
    struct node* pTempPointer = pMyNode->pNext;
    pTempPointer->data = 123;
    pTempPointer->pNext = NULL;
 
    free(pMyNode->pNext);
    free(pMyNode);
}