任何人都可以帮助我这行代码做什么:
((struct mac_tb_ind *) (tb_p->data))->first_bit = 0;
结构体定义如下:(tb_p是mem_block_t的种类)
struct mac_tb_ind {
unsigned char *data_ptr;
unsigned short size;
unsigned char error_indication;
unsigned char first_bit;
};
typedef struct mem_block_t {
struct mem_block_t *next;
struct mem_block_t *previous;
unsigned char pool_id;
unsigned char *data;
} mem_block_t;
答案 0 :(得分:1)
tb_p->data
指针存储在data
。
(struct mac_tb_ind *) (tb_p->data)
对指针进行类型转换,以便编译器知道如何解释它
((struct mac_tb_ind *) (tb_p->data))->first_bit = 0;
first_bit
中存储的值设置为0