This seems correct to me but my gcc compiler does not like it. I am getting an error of:
I must be missing something rather simple. Here is my code.Code:error: 'Wordbyte' does not name a type
Anyone have an idea? Thanks in advance.Code:#ifdef BIG_ENDIAN struct WordByte { unsigned int zero:8; unsigned int one:8; unsigned int two:8; unsigned int three:8; }; #endif #ifdef LITTLE_ENDIAN struct WordByte { unsigned int three:8; unsigned int two:8; unsigned int one:8; unsigned int zero:8; }; #endif union Word { unsigned int word; WordByte byte; //<<here is where the error is pointing to. };