Message-ID: From: "Cristovao Braga" To: "Iain Buchanan" Cc: "djgpp list" Subject: Re: DJGPP Structs Date: Sun, 2 Mar 1997 02:29:30 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit > From: Iain Buchanan > > struct defPt > { > float x, y, z; > int sx, sy; > }; > > And an array full of pointers to such structres: > defPt *View[25][25]; > That's how I'd do it: #define max_x 25 #define max_y 25 defPt *View; main () { View = (defPt *) malloc (sizeof (defPt) * max_x * max_y); // referencing *(View + x + y * max_x) = 25; some_int = (View + x + y * max_x)->sx; } You'll get warnings saying that you are converting int to pointer whithout a cast. Just ignore them. It works. (Unless someone else knows something else about it that I don't). Cristovao Braga.