typedef struct
先看下面一段代码,
typedef struct CLIF_option_struct CLIF_option; struct CLIF_option_struct { const char *short_opt; const char *long_opt; const char *arg_name; const char *help_string; int (*function) (CLIF_option *optn, char *arg); void *data; int (*function_plus) (CLIF_option *optn, char *arg); unsigned int flags; }; #define CLIF_END_OPTION { 0, 0, 0, 0, 0, 0, 0, 0 }
在定义一个结构体时,如果其成员引用到了本身,为了方便表达,可以在定义该结构体前,给该结构体一个别名。