I have declared these two structures:
typedef struct {
int skip_lines;
int num;
int i;
char filename[70];
char main_directory[16];
char submain_directory[100];
} TABLE_;
typedef struct {
TABLE_ radiation_insolation[7];
TABLE_ radiation_radiation[5];
TABLE_ winds[9];
TABLE_ pressure[1];
TABLE_ humidity[1];
TABLE_ temperature[4];
} TABLES;
In main function I want to create array of arrays of the type TABLE_.
TABLES tables; // this will be filled with data later
// Now my pseudo-code:
TABLE_ ** table_arrays;
table_arrays[0] = tables.radiation_insolation;
table_arrays[1] = tables.radiation_radiation;
table_arrays[2] = tables.winds;
table_arrays[3] = tables.pressure;
table_arrays[4] = tables.humidity;
table_arrays[5] = tables.temperature;
What I want to do is that first element of table_arrays points to tables.radiation_insolation. The next element to tables.radiation_radiation and so on. I know the way I do it now is wrong, so I ask you how to do it correctly?
int
. Now, can you define an array ofint
? Then you can define an array ofTABLE_
as well.TABLE_
" did you mean "of the typeTABLES
"?TABLE_ radiation_insolation[7]
is array of type TABLE_. So I need array of arrays of type TABLE_TABLES
at all?TABLES tables
is a wrapper for the arrays. The code is there for context purposes.