->是結構體的指針
#include <stdio.h>
struct re {
int a;
struct re* b;
};
int main()
{
struct re c;
struct re d;
d.a = 2;
c.b = &d;
printf("%d\n",(*(c.b)).a);
printf("%d\n",c.b->a);
}
比方說你有一個結構體c裏有個指向另一個結構體d的指針b
d裏面有一個int型指針a
其中 * a 得2
普通用2的話是
(*(c.b)).a纔是2
但如果用->的話
c.b->a就是2
-> 就等於先加個 * 再加個 .