Accessing pointer to pointer of struct using -> operator

前端 未结 1 1696
时光取名叫无心
时光取名叫无心 2021-01-24 12:21

I have this code:

#include
#include

struct node
{
    int data;
    struct node *next;
};

void pointerOfPointer(struct node **re         


        
相关标签:
1条回答
  • 2021-01-24 12:55

    Remember that foo->bar is just syntactic sugar for (*foo).bar. What you're asking for is essentially (**reference).data, which you can rewrite as (*reference)->data if you want.

    0 讨论(0)
提交回复
热议问题