Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!ames!amdahl!dgcad!dg-rtp!dg-rtp.dg.com!hagins From: hagins@dg-rtp.dg.com (Jody Hagins) Newsgroups: comp.lang.c Subject: Re: prototyping (oh no! not again??) Message-ID: <1990Nov27.183041.8889@dg-rtp.dg.com> Date: 27 Nov 90 18:30:41 GMT References: <1990Nov27.001813.9244@ux1.cso.uiuc.edu> Sender: usenet@dg-rtp.dg.com (Usenet Administration) Reply-To: hagins@dg-rtp.dg.com (Jody Hagins) Distribution: comp Organization: Data General Corporation, Research Triangle Park, NC Lines: 63 In article <1990Nov27.001813.9244@ux1.cso.uiuc.edu>, gordon@osiris.cso.uiuc.edu (John Gordon) writes: |> |> Given that you are passing an n-dimensional array to a function, you |> *MUST* explicitly provide at least n-1 of the dimensions in the argument |> declaration. |> |> For example: |> |> if my_array is a 4-dimensional array, you *must* explicitly |> provide at least 3 of the dimensions when you pass my_array to a function. |> |> main() |> { |> int my_array[6][5][4][3]; |> . |> . |> . |> } |> |> |> function_one(int array[6][5][4][]) |> { |> . |> . |> . |> } |> |> Note: There is a rule that governs which dimension may be left out; I |> think it is one of the end ones, but I am not sure which one. |> |> Why can you not do the following? function_one(int *array) { . . . } You do not need to declare the size of the array (or number of indecies) and you can still access the individual elements of the array. |> |> --- |> John Gordon |> Internet: gordon@osiris.cso.uiuc.edu #include |> gordon@cerl.cecer.army.mil #include |> Jody Hagins hagins@gamecock.rtp.dg.com