delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/02/10:50:46

Posted-Date: Sun, 2 Mar 1997 09:40:30 -0600 (CST)
Message-Id: <199703021540.JAA06233@mail.texoma.net>
From: "Mark S. Teel" <mteel AT texoma DOT net>
To: "Iain Buchanan" <Iain AT BuchananFamily DOT demon DOT co DOT uk>
Cc: "DJGPP" <djgpp AT delorie DOT com>
Subject: Re: DJGPP Structs
Date: Sun, 2 Mar 1997 09:43:20 -0600
MIME-Version: 1.0

>I've got a structure as follows:

>struct defPt
>{
>    float x, y, z;
>    int sx, sy;
>};

>And an array full of pointers to such structres:
>defPt *View[25][25];

Note: this is a 25X25 array of pointers of type (struct defPt *)...

>When I try and do this.... ("x" and "y" are of type int, and each go from
>0-24)
>defPt *View[x][y] = calloc(1, sizeof(defPt));

This would work:
View[x][y] = calloc(1, sizeof(defPt));

>I get an error message "Error: variable-sized object of type `defPt
>*[1][1]' may not be initialized"  I used to use Turbo C and never had any
>problems of this sort - surely the structure is pretty fixed size?  I've
>checked through the documentation and could find nothing.  Is there any
way
>of making it a "fixed size" rather than "variable size"... 
>Why the hell is it changing in size anyway!?

HTH,

MST

- Raw text -


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