C++,链表结构体语句分析

如下代码:Node(const int& d):data(d),next(NULL){} 这句是什么意思?

struct Node{
    int data;
    Node *next;
    Node(const int& d):data(d),next(NULL){}
};
#include<stdio.h>
struct Node{
    int data;
    Node *next;
    Node(const int& d):data(d),next(NULL){}
};

int main(){
    Node point = Node(4);
    printf("%d",point.data);    //数据域就是4  指针域就是NULL
    return 1;
}

带参数的构造函数吧。在C++类中是有这种写法的,带参数的构造函数,构造一个对象。在结构体里面,功能一样,可以构造一个结构体实例。

C和C++完整教程:https://blog.csdn.net/it_xiangqiang/category_10581430.html
C和C++算法完整教程:https://blog.csdn.net/it_xiangqiang/category_10768339.html