Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/15/85; site vger.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!ihnp4!pesnta!parallel!vger!emacs From: emacs@vger.UUCP Newsgroups: net.lang.c Subject: Structure question (problem) Message-ID: <185@vger.UUCP> Date: Mon, 20-May-85 15:40:06 EDT Article-I.D.: vger.185 Posted: Mon May 20 15:40:06 1985 Date-Received: Fri, 24-May-85 01:42:07 EDT Organization: UC Santa Cruz, CIS Dept. Lines: 45 Could someone please inform me what the hell I am doing wrong. The subject is auto-initialization of structures. Here is a simple program that trys to initialize the stucture, and the associated error message. If I take one of K&R's examples (pg 124, last half page), I get the same error. BTW-This is 4.2bsd. ===== /* Structure test */ #include main() { static char *text[] = { "Fred", "Wilma", "Barney", "Betty" }; struct l { int a; int b; char *c; int d; } e = { 0, 1, text[0], 4 }; printf("Fred is married to Wilma, Barney to Betty...\n"); } ===== % cc t.c "t.c", line 14: no automatic aggregate initialization "t.c", line 14: warning: illegal combination of pointer and integer, op = Why can I not automatically initialize. K&R says I can. This must and has to be a real simple fix. What am I doing wrong? -- --------------------- ...Lying on the beach in the sun... | |------------------------------------------------------- | Michael E. Dove | Usenet: ucbvax!hplabs!pesnta!parallel!ucscv!emacs | | CIS Consultant | ihnp4!sun!parallel!ucscv!emacs | | UC Santa Cruz, CA | CSNet: emacs@ucsc.csnet | | | Arpa: emacs%ucsc.csnet@csnet-relay.arpa | ---------------------------------------------------------------------------- --