Define functions in structs

后端 未结 10 994
南旧
南旧 2020-12-08 08:58

Can we define functions in structs in C programming language?

10条回答
  •  误落风尘
    2020-12-08 09:58

    No, you can't. Structs can only contain variables inside, storing function pointers inside the struct can give you the desired result.

提交回复
热议问题