Initialise a const char * const * with two strings in C
c, char, constants, initialization, pointers
Solution
Instead of pointers-to-pointers, use an array of pointers and initialize them like this:
const char * const strs[] = {"abcdefg", "hijklmnop"};
So instead of a constant pointer to string constants you now have a constant array to string constants. C does not allow initializing pointers with braces (unless there is only a single value in them), but it does allow for arrays to be initialized this way.
Problem
Does anyone know the correct way of initializing a `const char * const *` with two literal strings (`"abcdefg"` and `"hijklmnop"`)? I read it was difficult/not possible to convert from a `char **`, but I may be wrong. Any help much appreciated.