So in my main function I'm creating a 2D array:
int dataDim = 100;
float inData[2][dataDim];
I want to pass it to a function where I will be able to fill it up with data. How to pass it in a manner that I will be able to fill it up directly? Maybe
function(float** array)
and then accessing array[0][0] probably doesn't work? Strange how I can't find any quick example about this.
in C, multidimensional arrays' sizes must be known to pass as such, although some sizes may be omitted, if you like.
Exact
void function(float array[][100]);
void function(float (*array)[100]);
Syntactically Valid
Although the compiler may legally ignore the size 2.
void function(float array[2][100]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With