While solving questions related to linked lists in C++, the struct definition for implementation of list was given as follows.
Struct node{
int data;
node *next;
node(int x) : data(x), next(NULL) {}
};
what is the significance of 3rd line : " node(int x) : data(x), next(NULL) {} ".
Accessing it as a function is giving runtime error. Please share some resources where I can get a better understanding of the topic.
P.S.- I have just shifted from C to C++.