C
Cliff
Hi,
I'm in the process of porting some code from a 3rd party and have hit
a problem with the following:
typedef struct {
unsigned char Red;
unsigned char Green;
unsigned char Blue;
}TBoxColour;
//---------------------------------------------------------------------------
void DoSomething(void)
{
TBoxColour Col;
Col = (TBoxColour){10, 20, 30};
}
My compiler (CodeGear C++ Builder) complains with the error:
Improper use of typedef 'TBoxColour'
It seems a perfectly logical was of assigning values to the struct
members, but is it legal, or was the original programmer just
exploiting some quirk in a specific compiler (don't know which)?
Thanks
I'm in the process of porting some code from a 3rd party and have hit
a problem with the following:
typedef struct {
unsigned char Red;
unsigned char Green;
unsigned char Blue;
}TBoxColour;
//---------------------------------------------------------------------------
void DoSomething(void)
{
TBoxColour Col;
Col = (TBoxColour){10, 20, 30};
}
My compiler (CodeGear C++ Builder) complains with the error:
Improper use of typedef 'TBoxColour'
It seems a perfectly logical was of assigning values to the struct
members, but is it legal, or was the original programmer just
exploiting some quirk in a specific compiler (don't know which)?
Thanks