From: dan AT dan DOT emsphone DOT com (Dan Nelson) Newsgroups: comp.os.msdos.djgpp Subject: Re: Labelled array display element funny Date: 9 Oct 1996 20:39:51 GMT Organization: Executive Marketing Services, Inc. Lines: 23 Message-ID: <53h2in$3to@client3.news.psi.net> References: <7E03B4350B AT fs2 DOT mt DOT umist DOT ac DOT uk> Reply-To: dnelson AT emsphone DOT com (Dan Nelson) NNTP-Posting-Host: 199.67.51.101 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp A.Appleyard wrote: > This program:- > 1 #include > 2 typedef struct{char *codeno; char*name;} craft; > 3 craft dsub[128]={ > 4 [1] {"CH79","Aphanistor"}, > 5 [55] {"DS1 ","Quackers"}, > 6 [56] {"DS2 ","Donald"}, > 7 [23] {"BA32","Big Jim"}, > 8 [35] {"FA65","Trelawney"}}; > 9 main(){} > produced these errors:- > t$.cc:5: parse error before `[' > t$.cc:5: warning: aggregate has a partly bracketed initializer > t$.cc:6: parse error before `[' You just forgot the equals sign after the bracketed number: [1] = {"CH79","Aphanistor"}, [55] = {"DS1 ","Quackers"}, etc. will work. -Dan Nelson dnelson AT emsphone DOT com