Passing array of arbitrary dimension
Say I want to create a function which finds the highest number in an array of arbitrary dimension, how would I construct the parameters to receive such a variable?
I don't want to create max functions for each of the following:
Code:
double max(double *num, int length) {...}
double max2d(double **num, int length) {...}
double max3d(double ***num, int length) {...}
etc...
That would be painful. I'd rather have a universal function that takes an array of any dimension, along with the number of the dimension itself.