Unions
John Russell
john13 at garfield.MUN.EDU
Sat Oct 22 15:50:35 AEST 1988
>In article <322 at hrc.UUCP> dan at hrc.UUCP (Dan Troxel VP) writes:
>>Except for the memory savings, what are Unions suited for?
Although it might be considered under memory savings, another use is to
encode logically related but mutually exclusive pieces of information.
For example, expressing a point on the screen as either a video memory address
or an (x,y) pair. In this case it isn't the fact you can save a few
bits that's important, it's that a single object will always convey
the information regardless of how it's represented.
John
--
"The 68000 processor can't possibly handle a colour display. You must have a
68020 system and not know it."
-- Amiga and Atari ST owners shared a chuckle over this view
from sales *and* technical people at the local Apple dealer
More information about the Comp.lang.c
mailing list