Multiple choice technology programming languages

If char catname[15]; , which of the following is valid?

  1. catname[15] = "Millie";

  2. catname = "Millie";

  3. catname[ ] = "Millie";

  4. None are Valid

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In C/C++, you cannot assign a string literal to an array using array notation after declaration. Option A attempts out-of-bounds assignment, option B tries to assign to the array name directly (not allowed), and option C has invalid empty bracket syntax. String assignment requires strcpy() or similar functions, not direct assignment.