Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!botter!tjalk!dick From: dick@cs.vu.nl (Dick Grune) Newsgroups: comp.lang.c Subject: Re: union initialization Message-ID: <827@tjalk.cs.vu.nl> Date: Mon, 4-May-87 10:13:32 EDT Article-I.D.: tjalk.827 Posted: Mon May 4 10:13:32 1987 Date-Received: Tue, 5-May-87 03:30:39 EDT References: <3290@burdvax.PRC.Unisys.COM> <1722@plus5.UUCP> <455@haddock.UUCP> <6483@mimsy.UUCP> <881@wjvax.wjvax.UUCP> Reply-To: dick@cs.vu.nl (Dick Grune) Organization: VU Informatica, Amsterdam Lines: 17 A union looks like a struct, acts like a struct and quacks like a struct, except that only one member can be initialized at any one given time. So by analogy, a strong force in the universe: union { int i; char ch1; char ch2; } = {, 'X', }; /* which initializes the ch1 */ Dick Grune Vrije Universiteit de Boelelaan 1081 1081 HV Amsterdam the Netherlands dick@cs.vu.nl ...!mcvax!vu44!dick