Skip to main content
Post Closed as "Not suitable for this site" by Juraj, Michel Keijzers, MichaelT, Glorfindel, MatsK
deleted 21 characters in body
Source Link
Brethlosze
  • 337
  • 1
  • 4
  • 18

Analyzing this and this answers under Arduino, which should be the proper way to pass a matrix2D array into a function?

The arrays are fixed, but the function should be applicable to different sizes of 2D arrays.

// NOT COMPILING EXAMPLE
void f(int** x,const int m, const int n){
// access x as x[0][0], x[0][1], etc...
}

void main{}{
    int x[16][128];x1[16][128];
    f(xx1,16,128);
    int x2[64][16];
    f(x2,64,16);
}

Analyzing this and this answers under Arduino, which should be the proper way to pass a matrix into a function?

The arrays are fixed, but the function should be applicable to different sizes of arrays.

// NOT COMPILING EXAMPLE
void f(int** x,const int m, const int n){
// access x as x[0][0], x[0][1], etc...
}

void main{}{
    int x[16][128];
    f(x,16,128);
}

Analyzing this and this answers under Arduino, which should be the proper way to pass a 2D array into a function?

The function should be applicable to different sizes of 2D arrays.

// NOT COMPILING EXAMPLE
void f(int** x,const int m, const int n){
// access x as x[0][0], x[0][1], etc...
}

void main{}{
    int x1[16][128];
    f(x1,16,128);
    int x2[64][16];
    f(x2,64,16);
}
Source Link
Brethlosze
  • 337
  • 1
  • 4
  • 18

Cannot convert 'int (*)[size]' to 'int**'

Analyzing this and this answers under Arduino, which should be the proper way to pass a matrix into a function?

The arrays are fixed, but the function should be applicable to different sizes of arrays.

// NOT COMPILING EXAMPLE
void f(int** x,const int m, const int n){
// access x as x[0][0], x[0][1], etc...
}

void main{}{
    int x[16][128];
    f(x,16,128);
}