Path: utzoo!attcan!uunet!cs.utexas.edu!samsung!think!snorkelwacker!bloom-beacon!primerd!ENI!ENS!J.COOK From: J.COOK@ENS.Prime.COM Newsgroups: comp.sys.mac.programmer Subject: Re: Need large array on Think C. Message-ID: <1232500002@ENS.Prime.COM> Date: 30 May 90 09:56:00 GMT References: <26645@<265986A9> Lines: 39 Nf-ID: #R:<265986A9:-2664500:ENS:1232500002:000:1331 Nf-From: ENS.Prime.COM!J.COOK May 30 09:56:00 1990 ========> forwarded message from eco8941@ecostat.aau.dk There is not more problems in C than in other languages, you can get all the spped you want by using register variables. something like this should work: typedef char mytype[100][300]; mytype *globalarray; main() { globalarray = malloc( (unsigned long) sizeof(mytype) ); /* ^^^^^^ use your favourite allocation routine here */ . . } usearray() { register mytype *myarray; myarray[25][50] = 'a'; /* no overhead, direct in register */ } I haven't checked if I could make globalarray of register storage class, but that would remove the little overhead introduced in usearray(). ======================================================================== | Povl H. Pedersen | InterNet address: ECO8941@ecostat.aau.dk | | Student |----------------------------------------------| | Dept. of Economics | Spare time Mac Programmer | | Aarhus Universitet | Own Hardware: Mac SE, 4MB + 49MB SCSI HD | | DENMARK | Interests: Macintosh, C, boardgames | |======================================================================| [ Why I don't keep things in the right order ? I understand Chaos ! ] ========================================================================