Actions

EmSys

C - Unions2

From EdWiki

Unions ...

Unions may occur within structures and arrays, and vice-versa.

Union tagLSR {	
    struct  {
        unsigned int DataReady    : 1;
        unsigned int OverrunErr   : 1;
        unsigned int ParityErr	  : 1;
        unsigned int FrameErr	  : 1;
        unsigned int Break	  : 1;
        unsigned int THEmpty	  : 1;
        unsigned int TSEmpty	  : 1;
        unsigned int Notused	  : 1
    }bit;
    unsigned char byte;
}LSR;