21ic电子技术开发论坛's Archiver
论坛首页
›
侃单片机论坛
› C语言结构体中的变量如何被结构体内函数调用?
ee168
发表于 2022-2-2 21:25
七颗咖啡豆 发表于 2022-1-28 16:36
typedef struct _MY_DEMO{
int x;
int y;
int (*add)(struct _MY_DEMO *dd);
}MY_DEMO;
编译能通过吗?11楼是正确的,传VOID指针过去
hello、C
发表于 2022-2-5 08:39
ayb_ice 发表于 2022-1-19 11:43
total = demo.add(demo.x,demo.x);
是呢,为什么不这样呢?{:lol:}
页:
1
[2]
查看完整版本:
C语言结构体中的变量如何被结构体内函数调用?