我要定义一个结构体比如
typedef struct
{
unsigned char header;
unsigned char ...
unsigned char ...
}A_struct;
请问如何定义该结构体的header固定为0x5A? 我不想在其他引用地方去赋给header = 0x5a了.
typedef struct
{
unsigned char header;
unsigned char ...
unsigned char ...
}A_struct;
请问如何定义该结构体的header固定为0x5A? 我不想在其他引用地方去赋给header = 0x5a了.
{
A_struct()
:header( 0x5a)
{
}
unsigned char header;
unsigned char ...
unsigned char ...
}A_struct;