线程变量__thread使用

#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;

猜你喜欢

转载自blog.csdn.net/sun172270102/article/details/109728486
今日推荐