Dimensionless initialization of a structured multi-dimensional array (matrix).
Dimensionless initialization of a single dimension array
int myarray[] = { 0, 1, 2, 3, 4 5 };
Initialization of the multidimensional array.
This is how it is normally done
int myarray[3][2] = { {0, 1}, {2, 3}, {4, 5} };
Without specifying the first dimension size, inferred
int myarray[][2] = { {0, 1}, {2, 3}, {4, 5} };
This does not work. I don't know why? I such a thing possible? I don't see why not. I just can't figure out how.
int myarray[][] = { {0, 1}, {2, 3}, {4, 5} };
Now try that on a multidimensional structured array. That is my end goal. That's why I would like to accomplish.
struct DATA_T
{
int B1;
int B2;
int B3;
int B4;
};
/*
* Infer the dimensions of the array from assignment
* Remove the 4 and get it to work
*/
struct DATA_T DATA[][4] =
{
{
{ 1, 1, 1, 1 },
{ 2, 2, 2, 2 },
{ 3, 3, 3, 3 },
{ 4, 4, 4, 4 },
},
{
{ 5, 5, 5, 5 },
{ 6, 6, 6, 6 },
{ 7, 7, 7, 7 },
{ 8, 8, 8, 8 },
}
};
TIA,