We can initialize a struct with zero length array as specified in the link:
Zero-Length.
I\'m using the following structures:
typedef unsigne
Better to use payload[] instead of payload[0] in C99. Some of C99 compilers discourage usage of zero length array. So, in case you get an error here :
typedef struct CommandHeader
{
UINT16 len;
UINT8 payload[0];
} CommandHeader;
you can always correct it as :
typedef struct CommandHeader
{
UINT16 len;
UINT8 payload[];
} CommandHeader;