Unions

Every system needs one terry at wsccs.UUCP
Sun Oct 30 11:03:57 AEST 1988


In article <6142 at june.cs.washington.edu>, pardo at june.cs.washington.edu (David Keppel) writes:
> dan at hrc.UUCP (Dan Troxel VP) writes:
> >Except for the memory savings, what are Unions suited for?
> 
> Well, I guess that they indicate something about the usage of the
> fields in the union.  This is a programmer convenience rather than a
> runtime convenience.

Packets.  It is nice to have a model which resembles reality.  The type field
would, of course, not be included within the union.

Namelists.	You can use symbol table information in a debugger in a way
that was not intended in the compiler.  Sharing common data structures is
desirable thing when writing a debugger.

Different reading and writing models for devices.  This can be used to speed
up disk I/O immensely.


| Terry Lambert           UUCP: ...{ decvax, uunet } ...utah-cs!century!terry |
| @ Century Software        OR: ...utah-cs!uplherc!sp7040!obie!wsccs!terry    |
| SLC, Utah                                                                   |
|                   These opinions are not my companies, but if you find them |
|                   useful, send a $20.00 donation to Brisbane Australia...   |
|                   'I have an eight user poetic liscence' - me               |



More information about the Comp.lang.c mailing list