I have a struct with pointers to floats that i want to turn into an array of an indeterminate size. At the beginning of my program I want to declare a few of these structs and turn them into different sized arrays, like this:
struct _arr {
float * a;
}
...
_arr x;
x.a = (float *)malloc(sizeof(float)*31);
x.a = { 6,
1, 1, 1, 0 , 0 ,
1, 0, 1, 0 , 0.0625,
1, 1, 0, 0.0625, 0 ,
1, 0, 1, 0 , 0.0625,
1, 0, 0, 0.0625, 0.0625,
1, 1, 0, 0.0625, 0
};
Unfortunately this doesn't work, does anyone have any suggestions get the values into the array besides adding in each value in individually (such as a[0] = 6;)?