I am trying to pass a two-dimensional array, the size of which can be dynamic, as an argument to the method.
Inside the method, I would like to use an array with the syntax of a common array.
int item = array[row][column];
Array passing is not possible, so I was thinking about using a pointer pointer.
- (void)doSomethingWithArray:(int **)array columns:(int)nColumns rows:(int)nRows
{
int item = array[n][m];
}
But I get a problem when I try to pass an array as a parameter
int array[numberOfRows][numberOfColumns];
[someObject doSomethingWithArray:array columns:numberOfColumns rows:numberOfRows];
I found a lot of tips and tricks, but for some reason nothing works the way I would like to use it.
Thanks for the help, Eny.
Enyra source
share