【发布时间】:2017-05-27 13:43:58
【问题描述】:
我正在尝试使大量数据更易于管理。
#pragma anon_unions
typedef union
{
uint8_t Contents[PACKET_SIZE];
struct
{
uint8_t Command;
uint8_t X[24];
uint8_t Y[24];
uint8_t Z[16];
uint8_t something;
.
.
.
};
struct
{
uint8_t Command; // have to rename to dummy_Command to avoid compiler error
uint8_t A;
uint8_t B[6];
uint8_t C[48];
.
.
.
};
} PacketToFromFile;
有没有办法在没有任何编译器错误的情况下仍然使用相同的名称,例如“命令”?
【问题讨论】:
标签: c structure c99 unions keil