【发布时间】:2013-12-16 10:59:27
【问题描述】:
我完全被困在这一点上。我有以下代码:
typedef void (*TPFN_ACC)(void);
typedef char (*TPFN_EVE)(void);
typedef struct {
int idDestino;
char * nombre;
TPFN_EVE evento;
TPFN_ACC accion;
} TRANSICION;
然后我这样做:
TRANSICION transiciones_Stopped[] = {
{UPLEFT, "t_Stopped_to_Up_Left", ev_up_left, acc_up_left},
{0, 0, 0, 0}
};
我收到了这个警告:
warning: initialization from incompatible pointer type
你能帮帮我吗?
提前致谢。
【问题讨论】:
-
你能显示
ev_up_left和acc_up_left的声明吗?它们要么不可见,要么属于不同类型。 -
void ev_up_left(); char acc_up_left();
-
好的,看我的回答,你交换了两种类型。
-
天哪,多么愚蠢的错误。谢谢大佬!!
-
@Aldridge1991
typedef void (*TPFN_ACC)(void);是什么意思?我是C的初学者。
标签: c pointers warnings function-pointers