Hello,
I have some problems using a dynamically allocated struct array that I hope someone could help me out with.
typedef struct THINGY
{
/* should point to an array of STUFF */
STUFF *array;
}THINGY;
[...]
THINGY *thingy = malloc(sizeof(THINGY));
/* allocates an array of length 100 */
thingy.array = (STUFF *)malloc(100 * sizeof(STUFF));
/* and this causes an compiler error:
"subscript requires array or pointer type" */
thingy.array[0] = NULL;
The following line causes an error while compiling:
thingy.array[0] ...
The error reads:
subscript requires array or pointer type
Thanks