...
Code Block | ||
---|---|---|
| ||
char s[3] = { 'a', 'b', 'c' }; /* NOT a string */ |
Also, one you should make clear in comments or documentation if a character array is, in fact, not a null-terminated byte string.
STR36-EX2: If the string being initialized might change in the future, one you may explicitly specify an array bounds. This is particularly important if the array might hold strings longer than the initialization string.
...