I have this structure:
typedef struct
{
union{
int bytex[8];
int bytey[7];
}Value ;
int cod1;
int cod;
} test;
and want to initialize the constant test as follow:
const test T{
.Value.bytex = {0x11,0x22,0x33,0x44,0x11,0x22,0x33,0x44},
.cod1=0,
.cod=1,
};
I am getting the following error
Expected primary-expression before '.' token
This initialization is however correct:
const test T{
{0x11,0x22,0x33,0x44,0x11,0x22,0x33,0x44},
.cod1=0,
.cod=1,
};
Do you have any Idea ?