Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!rg2c+ From: rg2c+@andrew.cmu.edu (Robert Nelson Gasch) Newsgroups: comp.sys.mac.programmer Subject: Think C question Message-ID: Date: 10 Oct 90 04:30:43 GMT Organization: Class of '91, Carnegie Mellon, Pittsburgh, PA Lines: 37 I have a think C problem. When I allocate the memory for the array of pointers in allocatelandscape, it progressiveley slows down. This is a real pain as MAXSIDE is 70 and after 50 rows or so, it is *very* slow. The structure is too big for it to be declared as an array, so I have to use pointers to allocate the memory. If anybody knows a remedy to this, please let me know. Thanx a million --> rob Here's the source: #include #define MAXSIDE 70 typedef struct { short food; short restorefood; short org1, org2; }squaretype; squaretype *landscape[MAXSIDE][MAXSIDE]; /* global var */ void allocatelandscape () { int x, y; for (x = 0; x < MAXSIDE; x++){ for (y = 0; y < MAXSIDE; y++) landscape[x][y] = (squaretype *) malloc (sizeof(squaretype)); printf (".");} } main () { allocatelandscape () }