Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rochester!ken From: ken@cs.rochester.edu (Ken Yap) Newsgroups: news.admin Subject: Re: How (not) to Program in C (was Re: PD C as solution to binary groups) Message-ID: <1668@sol.ARPA> Date: Wed, 31-Dec-69 18:59:59 EDT Article-I.D.: sol.1668 Posted: Wed Dec 31 18:59:59 1969 Date-Received: Fri, 28-Aug-87 05:49:23 EDT References: <6960@g.ms.uky.edu> <3725@ncoast.UUCP> <2527@whuts.UUCP> <2639@hoptoad.uucp> <1101@laidbak.UUCP> <3367@zen.berkeley.edu> <4261@ncoast.UUCP> Reply-To: ken@cs.rochester.edu (Ken Yap) Organization: U of Rochester, CS Dept, Rochester, NY Lines: 13 |Unions -- are NEVER necessary. The only legal use of a union is to shrink a |variable which can contain a number of different types of values; a struct |will work just as well, at a (possibly large) space penalty. Illegal uses, |such as: I beg to differ. Unions are useful. It is very useful in yacc to make the type returned by action routines a union, in fact yacc does some type checking for you if you have activated the %union feature. But then yacc doesn't exist on all systems with C so it is a bad example. Ken