Except what mac11 said in regards to the parameter declaration will not work. The parameter should be:
- float out[LATMAX60][LONMAX]
The first dimension shown (LATMAX60) is optional since in C/C++, this notation degrades into a pointer, so it is equivalent to:
- float out[][LONMAX]
-
// or
-
float (*out)[LONMAX]
in a parameter list.
If you want to have type safety, you can use a reference to the array (in C++)
- float (&out)[LATMAX60][LONMAX]
or in C, it would be a pointer to a 2d ARRAY:
- float (*out)[LATMAX60][LONMAX]
but that would require that you dereference the array prior to you accessing the elements in it. Like this:
- (*out)[row][col] = FMISSING;
The only other alternative is to do pointer arithmetic correctly. Like this:
-
*(out+row*latmax+col) = FMISSING;
-
I think that is right. I usually let the compiler do the work for me.
Adrian