Check out example codes for "how to use a new node c++". It will help you in understanding the concepts better.

Code Example 1

struct node(){
  int key; 
  node *next;
    key = x;
    next = NULL;     
// after you take a input of a linked list .
// creating a new node.
node *temp = new node(key);  // tem pointer pointing towards the new node. 
temp -> next = head; // inserting the mew node in the start .

Learn ReactJs, React Native from