为了做一个函数指针的typedef,我们做这样的事情,
typedef int (*func) (char*);
typedef struct{
char * name;
func f1;
}
Run Code Online (Sandbox Code Playgroud)
与此相反,我遇到了一个我不明白的代码.
typedef int rl_icpfunc_t (char *);
typedef struct {
char *name; /* User printable name of the function. */
rl_icpfunc_t *func; /* Function to call to do the job. */
char *doc; /* Documentation for this function. */
}COMMAND;
Run Code Online (Sandbox Code Playgroud)
这是libedit库示例的代码片段.有人可以向我解释一下吗?