If char catname[15]; , which of the following is valid?
-
catname[15] = "Millie";
-
catname = "Millie";
-
catname[ ] = "Millie";
-
None are Valid
D
Correct answer
Explanation
In C, you cannot assign a string literal directly to a character array after declaration using the assignment operator. catname[15] is out of bounds, catname = "Millie" tries to assign to an array name pointer, and catname[] is syntax error. None are valid.