How are multidimensional arrays defined in C?
a) As arrays of arrays
b) As arrays of functions
c) As arrays with variable sizes
d) As arrays with no elements
Answer:
a) As arrays of arrays
Explanation:
Multidimensional arrays in C are defined as arrays of arrays. For example, a two-dimensional array can be thought of as a table with rows and columns, where each row is an array, and all rows together form the larger array. The syntax for declaring a two-dimensional array is int array[row][column];
. Multidimensional arrays are useful for representing complex data structures like matrices and grids, and they are accessed using multiple indices.
Understanding multidimensional arrays is important for working with complex data structures that require multiple levels of indexing, such as matrices, tables, and 3D models.