Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!cwruecmp!hal!ncoast!simpsong From: simpsong@ncoast.UUCP Newsgroups: comp.lang.c Subject: Initialization of a two-dimen. array of structures. Message-ID: <2173@ncoast.UUCP> Date: Fri, 13-Mar-87 20:29:20 EST Article-I.D.: ncoast.2173 Posted: Fri Mar 13 20:29:20 1987 Date-Received: Sat, 14-Mar-87 20:14:58 EST Distribution: comp Organization: Cleveland Public Access UNIX, Cleveland, OH Lines: 45 *** Line eater food *** I have a structure like this: =============================== struct of_stuff { char *name float value; float another; int counter; } stuff[20][30] = { { "joe", 1, 0, 12, "fred", 1, 0, 13, "carol",1, 0, 4 } , { "joe", 1, 0, 12, "fred", 1, 0, 13, "carol",1, 0, 4 } } ====================================== This works fine on VMS 4.5 (VMS C - 4.?) and on my PC using MS C 3.0. However, when I tried it on a vax 11/780 running 4.3BSD and a Sun workstation running whatever they call Unix (the latest 3.0 I believe), I got an error. The error was repeated 4 times for each line that has a name in it (like "joe"), the error said I was missing a }. (or something to that effect.) My question is: What is the proper way to initialize a two dimensional array of structures... Thanks for any help, I thought I had it right till I tried BSD... Greg -- Gregory R. Simpson UUCP: {ihnp4, seismo, decwrl, philabs, ucbvax}!decvax!cwruecmp!ncoast!simpsong CSNET: ncoast!simpsong@case.CSNET ARPA: ncoast!simpsong%case.CSNET@Csnet-Relay.ARPA