_cian's blog

By _cian, history, 6 years ago, In English
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

  • Vote: I like it
  • -7
  • Vote: I do not like it

| Write comment?
»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

see http://www.cplusplus.com/doc/tutorial/classes/

The part where it is about "Constructors".