Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

how to make a linked list in c

typedef struct node{
    int value; //this is the value the node stores
    struct node *next; //this is the node the current node points to. this is how the nodes link
}node;

node *createNode(int val){
    node *newNode = malloc(sizeof(node));
    newNode->value = val;
    newNode->next = NULL;
    return newNode;
}
Source by gitlab.com #
 
PREVIOUS NEXT
Tagged: #linked #list
ADD COMMENT
Topic
Name
4+1 =