Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!seismo!harpo!floyd!vax135!ariel!hou5f!hou5a!hou5d!hou5e!mat From: mat@hou5e.UUCP Newsgroups: net.lang.c Subject: Re: array and structure initialization Message-ID: <554@hou5e.UUCP> Date: Sat, 11-Jun-83 23:42:43 EDT Article-I.D.: hou5e.554 Posted: Sat Jun 11 23:42:43 1983 Date-Received: Sun, 12-Jun-83 17:35:33 EDT References: sri-unix.5611 Lines: 43 Andrew: regarding the struct foo { char *f_slist[]; int f_code; }; This sort of cruft went away with v6. Remember that structures can be assigned nowadays. This requires that the structure length be stable for a given type of structure. Unfortuneately, it gets a little messy to do what you want, but this should do it char *f_list[] ={ "aaa", "bbb", "ccc", }; struct foo { char **f_list; int f_code; } bar[] ={ { f_list, 1 }, { . . . }, . . . }; If you have access to the v7 or later source for the Ritchie C compiler you may want to look at the output of the table encoding program. I can't say any more about that, but you have got a nuisance problem -- there is no general way to write constants for arbitrar compound objects except in a few (admittedly VERY useful) cases in initializers. ADA (TM of DOD and all that rot) does solve this problem, but the fairly general solution is probably part of what gives the language it's horrid complexity. Mark Terribile