Ok so an array of char**
can be declared as char ** array[X]
but in my context i do not know my value X
yet but know the size of the other 2 dimensions.
So I tried to do this:
char *votes[NUMOFCANDIDS][25]={""};
//When I said I know the size of other 2 dimensions, it refers to NUMOFCANDIDS and 25
But I got this error on this line:
votes=malloc(voters * sizeof(*votes));
//Error:assignment to expression to array type
So that's when I knew my declaration is wrong. I also did not declare it as char***
and dynamically allocate the 3 dimensions because I had this notion "Only use the heap when you don't know how much to allocate."
So, in short, my question is how to declare an array of char**
when you already know the value of last 2 dimensions but not the first? Hopefully, an explanation can accompany what I'm doing wrong and why you are correct.