J
john
Hello,
how do I merge the following two structures using an union?
struct {
unsigned char A;
unsigned char R;
unsigned char G;
unsigned char B;
} Color;
struct {
unsigned long ARGB;
} Color;
I want the following two blocks of code to be equivalent (in data memory):
Color.A=0x10; Color.R=0x20; Color.G=0x30; Color.B=0x40;
and
Color.ARGB=0x10203040;
Thanks!
John
how do I merge the following two structures using an union?
struct {
unsigned char A;
unsigned char R;
unsigned char G;
unsigned char B;
} Color;
struct {
unsigned long ARGB;
} Color;
I want the following two blocks of code to be equivalent (in data memory):
Color.A=0x10; Color.R=0x20; Color.G=0x30; Color.B=0x40;
and
Color.ARGB=0x10203040;
Thanks!
John