结构体 初始化 赋值

按顺序,数组用{}

1 struct node
2 {
3     int a;
4     int b[5];
5     int c[10];
6 };
7 node nod={1,{2,3},{4,5,6}};

赋值:整个拷贝,而不是拷贝地址

struct node
{
    int d;
};

    node a,b;
    b.d=1;
    a=b;
    printf("%d
",a.d);
    b.d=2;
    printf("%d
",a.d);
原文地址:https://www.cnblogs.com/cmyg/p/10069703.html