Which of the following is NOT a correct way of declaring and initializing array in C?
Show answerHide answer
Correct answer: (C) char arr[6]; arr = “consultancy”;
Explanation
An array name is not a modifiable lvalue, so a string cannot be assigned with arr = "..." after declaration (and "consultancy" needs 12 chars, more than 6). Strings must be given at initialisation or copied with strcpy.