Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!gatech!bloom-beacon!eru!hagbard!sunic!ericom!eos.ericsson.se!epames From: epames@eos.ericsson.se (Michael Salmon) Newsgroups: comp.lang.c Subject: Re: prototyping (oh no! not again??) Message-ID: <1990Nov29.114311.12344@ericsson.se> Date: 29 Nov 90 11:43:11 GMT References: Sender: news@ericsson.se Reply-To: epames@eos.ericsson.se Distribution: comp Organization: Ericsson Telecom AB Lines: 26 In article John E. Davis writes: > I have a function that takes a 2-d array of unknown dimension and does > things with it. How do I declare and call it? > You could try this approach, I haven't tried it but I'm pretty sure that it will work. I have used 4x4 because I hate typing but the idea is of course extensible both in the size and number of dimensions. double actual[4][4]; double *matrix[4] = { actual[0], actual[1], actual[2], actual[3] } Your call to trace will now be correct and you should be able to access matrix[i][j] as you are used to. The major disadvantage as far as I can see is that matrix must be external or static to allow initialization or you will have to initialize it manually. Hope that this is some help. Michael Salmon L.M.Ericsson Stockholm