I'm trying to declare a long 2-dimensional array like this, so i can later copy the long array into the small array that's the right size:
double arr_long[MAX][2]; double arr[][];
so i can later use:
arr = malloc(amount*sizeof(double[2]));
and then copy all the elements over. (i'm filling the long array with a simple for loop) But my compiler gives me an Error, saying "array type has incomplete element type" about the declaration. Is there no way to declare a multidimensional array without specifying its size?
double (*arr)[2]
. But it's just easier to juststruct something { double elements[2]; }
withstruct something *arr;
– KamilCuk