Re: [Algorithms] How to get 3dvector largest coordinate index?
Brought to you by:
vexxed72
From: Will V. <wi...@se...> - 2009-03-05 03:23:38
|
On Thu, 05 Mar 2009 15:33:32 +1300, Jeff Russell <je...@8m...> wrote: > isn't storing bytes and interpreting them as different types what unions > are for? I think the original intent of unions is to store discrete instances of variant types, rather than as a mechanism for reinterpreting. So you read and write the same type through the union, rather than reading one and writing the other. Typically you wrap this up in a struct with a label field (to tell you what's in the union, so you don't read and write the wrong thing) plus the union payload itself. Cheers, Will |