S
Steve
I want an initializer for an array of pointers to arrays of strings.
So I can do something like this:
const char *t1[] = { "a", "b", "c", NULL };
const char *t2[] = { "p", "q", NULL };
const char *t3[] = { "w", "x", "y", "z", NULL };
const char **test[] = { t1, t2, t3, NULL };
I was wondering whether the is a more elegant way of writing such an
initializer, one that does away with all the redundant names t1, t2, etc.
For a 2d array of strings I could do:
const char *test2[][5] =
{
{ "a", "b", "c", NULL, NULL },
{ "p", "q", NULL, NULL, NULL },
{ "w", "x", "y", "z", NULL }
};
Is there something similar for arrays of pointers to arrays of strings?
So I can do something like this:
const char *t1[] = { "a", "b", "c", NULL };
const char *t2[] = { "p", "q", NULL };
const char *t3[] = { "w", "x", "y", "z", NULL };
const char **test[] = { t1, t2, t3, NULL };
I was wondering whether the is a more elegant way of writing such an
initializer, one that does away with all the redundant names t1, t2, etc.
For a 2d array of strings I could do:
const char *test2[][5] =
{
{ "a", "b", "c", NULL, NULL },
{ "p", "q", NULL, NULL, NULL },
{ "w", "x", "y", "z", NULL }
};
Is there something similar for arrays of pointers to arrays of strings?