Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uwm.edu!rpi!uupsi!sunic!kth.se!news From: d88-jwa@nada.kth.se (Jon W{tte) Newsgroups: comp.sys.mac.programmer Subject: Re: Need large array on Think C. Message-ID: <1990May31.103925.13522@kth.se> Date: 31 May 90 10:39:25 GMT References: <26645@<265986A9> <1232500002@ENS.Prime.COM> Sender: news@kth.se (News Administrator) Reply-To: d88-jwa@nada.kth.se (Jon W{tte) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 16 In article <1232500002@ENS.Prime.COM>, J.COOK@ENS.Prime.COM writes: > ========> forwarded message from eco8941@ecostat.aau.dk > typedef char mytype[100][300]; > globalarray = malloc( (unsigned long) sizeof(mytype) ); > /* ^^^^^^ use your favourite allocation routine here */ > myarray[25][50] = 'a'; /* no overhead, direct in register */ This most definately won't work, since you NEVER have anything but one-dimentional arrays in C. You'll have to go through the procedure of allocating pointers to the various rows, and then allocating the rows. I posted how to do this one or two days ago. Jon W{tte, Stockholm, Sweden, h+@nada.kth.se