compilation error: request for member in something not a structure or union

前端 未结 2 962
清歌不尽
清歌不尽 2021-01-18 02:05

Edit: The code below has been modified to work as the problem has been solved.

Specifically, (*hardwareList.next_item)->next

2条回答
  •  无人及你
    2021-01-18 02:31

    My guess the problem is this piece of code: *(hardwareList.next_item)->data

    next_item is a pointer to a pointer, so my guess is that the compiler reads this as *((hardwareList.next_item)->data) which of course doesn't work - pointers don't have any members in C.

    Try ((*(hardwareList.next_item))->data) to get the correct dereference order.

提交回复
热议问题