Advertisement

Question on C++ 'union'

Started by August 14, 2000 04:01 PM
10 comments, last by Lord Chaos 24 years, 4 months ago
Actually, I will use it for ...

struct abc
{
BYTE a ;
BYTE r ;
BTYE g ;
BYTE b ;
} ;

union zeta
{
DWORD color ;
abc components ;
};

I thought this was a easy way to do bit shifting ... any comments ?
Intel uses the union/struct way for their SSE instruction code samples - so it can''t be that unreliable
I''ve used this technique for my vectors, and it works very well.


Give me one more medicated peaceful moment.
~ (V)^|) |<é!t|-| ~
ERROR: Your beta-version of Life1.0 has expired. Please upgrade to the full version. All important social functions will be disabled from now on.
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.

This topic is closed to new replies.

Advertisement