结构体指针

  1. // 引用结构体指针变量指向的结构体变量的成员的方法
  2. struct stu{
  3. int score;
  4. string name;
  5. }*p;
  6. 指针名->成员名
  7. (*p).score;
  8. (*指针名).成员名
  9. p->score
  1. // 自引用结构
  2. struct node{
  3. int x, y;
  4. node *next;
  5. }