#define MAX_CALLBACK_TYPE 100
static struct {
char stu_type;
int flags;
void *callback;
} msg_callback[MAX_CALLBACK_TYPE] ;
如上结构体初始化:
#define MAX_CALLBACK_TYPE 100
static struct {
char stu_type;
int flags;
void *callback;
} msg_callback[MAX_CALLBACK_TYPE] = {
{
type_1, MALE, test_callback},} ;
错误的初始化方式:
msg_callback[0].stu_type = xxx;
msg_callback[0].flags = xxx;