I have a struct that looks like this:
typedef struct TestCase TestCase;
typedef struct TestCase {
char * userName;
TestCase *c[]; // flexible array member
} TestCase;
And in another File I'm trying to set the flexible array member to NULL, but this doesn't seem to work (I'm not allowed to change how it's been defined)
void readIn(FILE * file, TestCase ** t) {
*t = malloc(sizeof(TestCase));
(*t)->c = NULL; //gives the error
}
I'm using double pointers because that's what's been specified for me (This isn't the entire code, but just a snipit). (As there is also code later to free the variables allocated).
Any help would be greatly appreciated.