Which declaration is valid for a 2D array in C?
Show answerHide answer
Correct answer: (A) int arr[2][2] = {1,2,3,4};
Explanation
A 2D array can be initialised with a flat list when both sizes are given: {1,2,3,4} fills row by row. [2,2] is not C syntax, and only the first dimension may be left empty.