Please read the new rule regarding the restriction on the use of AI tools. ×

How to use new to make a node

Revision en2, by _cian, 2020-07-29 08:41:23
This part of the code is given:

struct Node 
{
    int data;
    struct Node* next;
    Node(int x) { data = x;  next = NULL; }
};
to make a new node which keywords i have to use in c++?

is it :
Node* new_node=new Node()(This is not working)
or somethings

Tags #linked list

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English _cian 2020-07-29 08:41:23 15
en1 English _cian 2020-07-29 08:40:55 325 Initial revision (published)