I'm trying to build a table of references from other tables as following:
//*** TABLE 1 ***
double ref_table1[2][3] = {{10, 5.100, 0},
{21, 17.620, 26}
};
double fit_table1[5][2] = {{0.020, 23},
{-0.450, 1},
{0.060, 2},
{0.098, 5},
{0.410, 1}
};
//*** TABLE 2 ***
double ref_table2[2][3] = {{10, 5.100, 0},
{21, 17.620, 26}
};
double fit_table2[5][2] = {{0.020, 23},
{-0.450, 1},
{0.060, 2},
{0.098, 5},
{0.410, 1}
};
(tables are equal here to simplify the example but they are of course different)
And then the place where I'm trying to make the references but keep getting error:
static double **tables[][2] = {{ref_table1, fit_table1},
{ref_table2, fit_table2}
};
then I took a read at this topic:
Create a pointer to two-dimensional array
and tried with:
static double (*tables)[][2] = {{ref_table1[0], fit_table1[0]},
{ref_table2[0], fit_table2[0]}
};
but still in this case i can't figure it out, how to do it correctly. I'm also wondering if that's actually possible since the ref_tables and fit_tables have different dimensions. I just thought it could be possible since they are all in the end references to 'double'. Any tips?
Thanks