That makes sense.
On the same token, why is:
Code:
1) char** stringArray = {"string1", "string2"}; //not allowed
2) char* stringArray[] = {"string1", "string2"}; //allowed
but
Code:
1) char* string = "text"; //allowed
2) char string[] = {'t','e','x','t','\0'}; //allowed
In both cases, the power of (1) is equal on both sides of assignment. Why is the program able to automatically allocate memory for char* string = "text" but not char** stringArray?
or even char** stringArray = {string}; (as defined in (1))
Is the long and short of this that, whenever a char** is initialized, you must dynamically allocate memory for it?