I have a struct that contains a char array like so:
typedef struct{
char *name[128];
} arr;
I thought I read earlier that the correct way to allocate memory for this would be:
arr thisOne;
thisOne->name = malloc(sizeof(char) * 128);
However, this results in an error:
incompatible types when assigning to type ‘char *[128]’ from type ‘void *’
Trying to cast the return from malloc doesn't help, as then I simply get a char * when I need a char *[128]. What am I doing wrong here?