“this” pointer in C (not C++)

后端 未结 7 1515
花落未央
花落未央 2020-12-24 09:42

I\'m trying to create a stack in C for fun, and came up with the idea of using struct to represent the stack. Then I add function pointers to the struct for push() and pop()

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-24 10:06

    C doesn't work like that. It's not an object oriented language. Functions that manipulate data structures need to take a pointer to the structure as an argument.

提交回复
热议问题