Arrow operator (->) usage in C

后端 未结 12 2053
醉梦人生
醉梦人生 2020-11-22 04:41

I am reading a book called \"Teach Yourself C in 21 Days\" (I have already learned Java and C# so I am moving at a much faster pace). I was reading the chapter on pointers a

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 05:27

    foo->bar is equivalent to (*foo).bar, i.e. it gets the member called bar from the struct that foo points to.

提交回复
热议问题