how to use a new node c++

C++
struct node(){
  int key; 
  node *next;
  node(x){  
    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 .




Source

Also in C++: