Passing address of multidimentional array

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have an array defined in main.c and with to access it from a
function in another file preferrably using array indices but pointers
would be OK. I am not sure how to specify the function parameter or
how to index the elements via the foreign function. Would like a
little advice rather than proceeding blindly because I often find that
just because something compiles it is not necessarily correct.

Thanks,

gtb

~~~~~~~~~~~~~~~

int arr[20][30];

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

//Other file here.

int functionInOtherFile( int* arr[}[])
{
//???
}
.



Relevant Pages

  • Re: NASM 0.98.39 vs. NASM 2.03.01 disassembly
    ... fixed bit size: an unsigned integer. ... :) Oh, and, of course, all pointers should've been ... alone keep track of pointer values and array indices. ... irritating bugs) and more related to the actual problems that the ...
    (alt.lang.asm)
  • Re: NASM 0.98.39 vs. NASM 2.03.01 disassembly
    ... fixed bit size: an unsigned integer. ... :) Oh, and, of course, all pointers should've been ... alone keep track of pointer values and array indices. ... irritating bugs) and more related to the actual problems that the ...
    (alt.lang.asm)
  • Re: C programming - problem with structures
    ... > ive been mucking about with structures and pointers and stuff, ... the one 'p' points to (remember, array indices start with 0 in C). ... And now you write even further over memory which isn't yours... ... the C language (but no extensions, ...
    (comp.programming)
  • Re: Creating BSP tree
    ... Morten, I'm not quite done with the optimized BSP tree that I'm working on, ... but you can use array indices instead of pointers. ... >> You could try changing the BSP_Node to a struct instead of a class. ... The original C-kode examples all> uses struct, with pointers to childs of the same type. ...
    (microsoft.public.dotnet.framework.performance)