Originally posted by Monster
Code:
void print_array(int **array, int row, int col);
you don't want to pass a pointer to a pointer to the datatype of the array. You want to pass just a pointer to the datatye of the array. IE
Code:
void DoSomething( Datatype* Array, unsigned int NumRows, unsigned int NumCols );
and then manually calculate element offset from row and column values within the function
If you happen to know the number of columns before-hand, you can do something like
Code:
void DoSomething( Datatype Array[][NumCols], unsigned int NumRows ); // Where NumCols is a constant
or if you knew both the number of rows and columns before hand you could do
Code:
void DoSomething( Datatype (&Array)[NumRows][NumCols] ); // Where NumRows and NumCols are constants