Re: Passing address of multidimentional array



"goodTweetieBird" <goodTweetieBird@xxxxxxxxxxx> wrote in message
news:b27993ba-2d39-40c6-b56d-7c3dae869bc0@xxxxxxxxxxxxxxxxxxxxxxxxxxx
int arr[20][30];

main(int argc, char** argv)
{
int rval;
...
rval = functionInOtherFile(arr);
}

//Other file here.

int functionInOtherFile( int* arr[}[])

You have to specify all but the leftmost dimension in the function
signature:

int functionInOtherFile( int arr[][30]);

--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: Which programming method is better?
    ... process("standard input", stdin, flags) ... and not a filename argument. ... preincrement argv first. ... I'd also go with const char* instead of char*, ...
    (comp.lang.c)
  • Re: Understanding char **argv
    ... char **argv looks like. ... So as to dereference what the pointer that *argv pointed to. ... but modifying argv while leaving argc alone is odd. ...
    (comp.lang.c)
  • Re: Style vs function? in arrays
    ... argv has type char **, and it's initially pointing at the first element ... When you do ++argv, you're moving it to point to ... the /second/ element in that array of char *. ... pointer incrementation, is there a good reason for this or is this ...
    (comp.lang.c)
  • Re: Tip 27: CONST qualifiers on pointer array arguments to TCL functions
    ... 'const' to char** (or more generally, arrays of pointers) arguments. ... possible if the argv itself is non-const) will likely break things ...
    (comp.lang.tcl)
  • Re: Understanding char **argv
    ... char **argv looks like. ... int main ... So as to dereference what the pointer that *argv pointed to. ...
    (comp.lang.c)