Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!wasatch!utah-gr!uplherc!sp7040!obie!wsccs!terry From: terry@wsccs.UUCP (Every system needs one) Newsgroups: comp.lang.c Subject: Re: Unions Keywords: What can they be used for? Message-ID: <759@wsccs.UUCP> Date: 30 Oct 88 01:03:57 GMT References: <322@hrc.UUCP> <6142@june.cs.washington.edu> Lines: 24 In article <6142@june.cs.washington.edu>, pardo@june.cs.washington.edu (David Keppel) writes: > dan@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 |