To initialize a char array, usually I write:
char string[] = "some text";
But today, one of my classmates said that one should use:
char string[] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't', '\0'};
I told him it is crazy to abandon readability and brevity, but he argued that initializing a char array with a string will actually create two strings, one asides in the stack and another in the read-only memory. When working with embedded devices, this can result in unacceptable waste in memory.
Of course, string initializers seems clearer, so I'll use them in my programs. But the question is, will a string initializer create two same string? Or string initializers are just syntax sugars?