union _Test
{
unsigned char keydata[4];
struct _Member
{
unsigned char a;
unsigned char b;
unsigned char c;
unsigned char d;
}Member;
}Test;
Test.keydata[4]= {
1,
2,
3,
4};
error on line 12: expected expression before '{' token.
If I declare without union,
const unsigned char keydata[NUM_KEYS]={
2,
1,
6,
5,
4,
7,
8,
9,
14, // DOWN
10, // ON/OFF
13, // RIGHT
11, // UP
12, // LEFT
16, // PUT
15, // PLACE
3
};
This work and compile success
If I declare without array,
union DisplayData
{
struct data2bytes
{
unsigned char lbyte;
unsigned char hbyte;
};
unsigned int data;
};
This also work and compile success
Anyone can guide me through this error?