From: "Ian Mausolus" Newsgroups: comp.os.msdos.djgpp Subject: register based calling Date: 8 Mar 1997 21:11:08 GMT Organization: ACC TelEnterprises Ltd. Lines: 5 Message-ID: <01bc2c04$dcd88540$0cb0f8ce@pquinney> NNTP-Posting-Host: ppp-012.toronto-01.ican.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Does anyone know how to do register based calling under DJGPP? Thanx, I. Mausolus from newsgroup comp.os.msdos.djgpp Iain Buchanan wrote: > 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]; This means, "Define a two-dimensional array of pointers to 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 means, "Allocate space for a single object of type defPt." If you want to allocate alll the space for them, you need to iterate through the two-dimensional array: for (int i = 0; i < 25; i++) for (int j = 0; j < 25; j++) View[i][j] = calloc(1, sizeof(defPt)); -- 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)