I\'m trying to write a C99 program and I have an array of strings implicitly defined as such:
char *stuff[] = {\"hello\",\"pie\",\"deadbeef\"};
Are all strings allocated the same amount of elements as the largest string in the definition?
No, only 3 pointer are allocated and they point to 3 string literals.
char *stuff[] = {"hello","pie","deadbeef"};
and
char stuff[3][9];
are not at all equivalent. First is an array of 3 pointers whereas the second is a 2D array.
For the first only pointer are allocated and the string literals they point to may be stored in the read-only section. The second is allocated on automatic storage (usually stack).