I'm currently writing a complex function that took me a great amount of time to conceive. This function uses an array of type: " struct foo* ", which was previously defined like this:
struct foo** array_of_pointers = NULL;
To make the code easier to understand, I decided to change the definition to:
struct foo* array_of_pointers[] = {NULL};
(The assignment is done to make it a strong symbol)
But now the problem is here:
array_of_pointers = (?) calloc(256, sizeof(struct foo*));
Intuitively I replaced " ? " with " struct foo* [ ] ". This looks weird and actually results in a compiler error: "cast specifies array type".
So my question is: Does anyone know what should be placed instead of " (?) " ?