Using arrow -> and dot . operators together in C

后端 未结 5 1432
灰色年华
灰色年华 2021-02-01 07:51

I was under the impression that it was possible to access data from a sub-node of a linked list or similar structure by using the arrow and dot operators together like so:

5条回答
  •  一整个雨季
    2021-02-01 08:18

    Since I don't see it mentioned explicitly:

    • Use -> to dereference the pointer on its left hand side and access the member on its right hand side.
    • Use . to access the member on its right hand side of the variable on its left hand side.

提交回复
热议问题