-2
struct node
{
    int info;
    node* next; 
    node(int D, node *N)
    :  info(D),next(N)
    {  }
};
node* list;

In the above declaration of a linked list what does the following mean?

node(int D, node *N)
        :  info(D),next(N)
        {  }
Jonathan Leffler
  • 698,132
  • 130
  • 858
  • 1,229

1 Answers1

1

It is the node constructor using initializer list to initialize its member variables.

CinCout
  • 9,044
  • 11
  • 51
  • 63