Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!ucbvax!pasteur!noble From: noble@icsia3.ICSI.Berkeley.EDU (Brian Noble) Newsgroups: comp.lang.c Subject: Question re external 2-dimensional arrays Message-ID: <13020@pasteur.Berkeley.EDU> Date: 24 Apr 91 21:37:34 GMT Sender: news@pasteur.Berkeley.EDU Organization: International Computer Science Institute, Berkeley, CA Lines: 35 Originator: noble@icsia3 Howdy! I have the following global array that is accessed by several source modules... double myArray[MAX1][MAX2]; The Question: what is the least computationally expensive way to declare this array as an external variable, so when I access an element in the array the complier knows the row length and (cheaply) calculates the correct offset into the array. my first intuition is... (1) define the following type: typedef myArrayT[MAX1][MAX2]; (2) declare the array to be: myArrayT myArray; (3) and declare the external reference as extern myArrayT myArray; Will this work? Is there a better way? Please respond via email as I don't have time to keep up with comp.lang.c. If there are a sufficient number of 'boy, I'd really like to know that too' I'll summarrize to the net. Brian Noble noble@tenet.berkeley.edu