What does the first dimension and the second dimension represents in a two-dimensional
What does the first dimension and the second dimension represents in a two-dimensional
character array?
AThe first dimension stores the length of each name, and the second stores the number
of names.
BThe first dimension represents the number of names in the array, and the second
dimension represents the maximum length of each name.
CThe first dimension represents the maximum length of the names, and the second
dimension represents the number of names.
DThe first dimension holds the total number of characters, and the second dimension
stores the number of names.
Show answerHide answer
Correct answer: (B) The first dimension represents the number of names in the array, and the second
dimension represents the maximum length of each name.
Explanation
In char names[N][L], the first dimension is the number of strings (rows) and the second is the maximum length of each string, including the null character.