Hi,
in a C program I have this variable:
float (*data)[3];
data = (float (*)[3])calloc(ntimes, sizeof(float[3]));
which later is initialized. Afterwards I want to pass all the info in "data" to a serie of ntimes variables called "data_i" that I define with:
typedef float (*el_i)[3];
el_i data_i[NTIMES]; // NTIMES is a constant with value "ntimes"
for (i = 0; i < ntimes; i++) data_i[i] = (float (*)[3])calloc(1, sizeof(float[3]));
and then I try to pass the info from "data" to all the "data_i"''s with
for (i = 0; i < ntimes; i++){
data_i[i][0][0]=data[i][0];
data_i[i][0][1]=data[i][1];
data_i[i][0][2]=data[i][2];
}
Do you think here that data_i[i][0][0] is the right syntax ? Is this the better way to do this transfer or copy of information ? Thanks