I assume this is basic question, but I'm not English and not used still with the terms of programming language, that's why I question here (I couldn't find).
Here's my context:
I have a structure (let's simplify it) as follow
struct _unit
{
char value;
} Unit;
and in the main program, I'd like to have a row of pointers that points a row of other pointers pointing structures Unit. Something like
int main ()
{
Unit** units;
..
printf("%d", units[0][0].value);
...
}
I get a little confused, what is the way to go so Unit's can be accessed as a multi-dimensional array.
here's my try
{
units = (Unit**)malloc(sizeof(void*));
units[0][0] = (Unit*)malloc(sizeof(Unit));
}