www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/25/05:26:41

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: quest: initializing many structs
Date: Mon, 24 Feb 1997 21:42:15 -0800
Organization: Alcyone Systems
Lines: 27
Message-ID: <33127BB7.10A4C24@alcyone.com>
References: <5ehr3s$3s3 AT mn5 DOT swip DOT net> <330C73F9 DOT 4D4 AT rpi DOT edu>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Brian Osman wrote:

> > void cube_init (struct cubestruct *cube)
> > {
> >         cube->point[1][1][0] = {+1, +1, -1};
> >         cube->point[1][1][1] = {+1, +1, +1};
> > };
> >
> > ----------------------------------------------
> > Vilhelm "Ville" Sjoeberg
> 
> Your struct declaration only makes the arrays with one element.
> So, only cube->point[0][0][0] is defined. Make it:
> 
> struct pointstruct point[2][2][2];
> 
> Got it?

Not to mention that his aggregate initializer syntax is only good in, well,
initializers.
-- 
       Erik Max Francis, &tSftDotIotE / email:  max AT alcyone DOT com
                     Alcyone Systems /    web:  http://www.alcyone.com/max/
San Jose, California, United States /    icbm:  37 20 07 N  121 53 38 W
                                   \
              "I am become death, / destroyer of worlds."
                                 / J. Robert Oppenheimer (quoting legend)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019