🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #51710

Problem initializing a structure array

#51710
From: Keith Mason
Date: Fri, 16 Apr 1993 03:06
24 lines
1143 bytes
I have a piece of code that looks like this:

  typedef struct _item {
    char *a;
    char *b;
  } item;

  item x[2] = {
    "One",  "Two",
    "Three, "Four"
  };

And I get back 

   file.c:9: warning: aggregate has a partly bracketed initializer
   file.c:9: warning: aggregate has a partly bracketed initializer
   file.c:9: warning: aggregate has a partly bracketed initializer
   file.c:9: warning: aggregate has a partly bracketed initializer

What am I doing wrong here?  And why isn't is correct?


Thanks...
Keith
Technical Details
Message-ID: <keithC5K3A3.Eq9@netcom.com>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!decwrl!netcomsv!netcom.com!keith

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,ffcc861fa54e6e8a,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-04-15 20:34:34 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!decwrl!netcomsv!netcom.com!keith
From: keith@netcom.com (Keith Mason)
Subject: Problem initializing a structure array
Message-ID: <keithC5K3A3.Eq9@netcom.com>
Organization: NETCOM On-line Communication Services (408 241-9760 guest)
Date: Fri, 16 Apr 1993 03:06:03 GMT
Lines: 24