Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: How do you declare a pointer to a two dimensional array? Message-ID: <14378@smoke.brl.mil> Date: 7 Nov 90 11:20:48 GMT References: <9197@aggie.ucdavis.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 12 In article <9197@aggie.ucdavis.edu> rogers@iris.ucdavis.edu (Brewski Rogers) writes: >given the array: > float spam[4][4]; >How do I declare a pointer to it? Is this possible? You don't declare a pointer to spam; however, you might declare a pointer to an array having the same type as spam and initialize it to point to spam. This may not work in pre-ANSI C compilers that don't allow you to take the address of an array, in which case you can use just spam or spam[0] and cast it to the desired type. float (*spamp)[4][4] = &spam; /* ANSI */ float (*spamq)[4][4] = ((*)[4][4])spam; /* others */