A
Anand
Greetings,
Can anyone, help me understand, why I am unable to intialize the structure
as stated below?
int normalArray[5] = {0x01, 0x02, 0x03, 0x04, 0x05};
typedef struct tag{
int value1;
int value2;
}myTypeStruct;
myTypeStruct myStrVar[2] = {
{normalArray[0],
normalArray[1]},
{normalArray[2],
normalArray[3]}
};
The compiler throws me error, stating that 'the structure intialization
requires a constant'.
The same initialization works on the Microsoft Visual Studio environment,
but fails on using Green Hills Compiler for my embedded application
programming.
Any insight, on the topic would be of great value.
Thanks for your help.
Best regards,
Anand
Can anyone, help me understand, why I am unable to intialize the structure
as stated below?
int normalArray[5] = {0x01, 0x02, 0x03, 0x04, 0x05};
typedef struct tag{
int value1;
int value2;
}myTypeStruct;
myTypeStruct myStrVar[2] = {
{normalArray[0],
normalArray[1]},
{normalArray[2],
normalArray[3]}
};
The compiler throws me error, stating that 'the structure intialization
requires a constant'.
The same initialization works on the Microsoft Visual Studio environment,
but fails on using Green Hills Compiler for my embedded application
programming.
Any insight, on the topic would be of great value.
Thanks for your help.
Best regards,
Anand