Is it possible to define a union at creation. ie:

union Colour
   unsigned int i;
   char c[4];
      char a;
      char r;
      char g;
      char b;

Assuming I understand your question, yes.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.