-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
  • 730,956
  • 141
  • 904
  • 1,278

1 Answers1

1

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

CinCout
  • 9,486
  • 12
  • 49
  • 67