在Git上看代码,看到连续使用->把人整懵了,有木有懂的讲解一下
这种L->a->b=c代码是什么意思
l是一个结构体,具有first、last成员,而l->last也是一个结构体,其具有next成员,
比如
struct lastStruct {
int next
}
struct l {
xx first,
lastStruct last
}
所以 l->last->next,访问的是 l 的last成员的 next属性。l->last->next=newnode,是在对last->next进行赋值。