In C, a one-dimensional array is a collection of elements of the same data type arranged in a contiguous block of memory. You can declare and initialize a one-dimensional array using the following syntax:
dataType arrayName[arraySize];
int numbers[5];
int numbers[5] = {1, 2, 3, 4, 5};
You can access individual elements of the array using their index. In C, array indexing starts from 0. For example:
int thirdElement = numbers[2]; // Accessing the third element (index 2) of the array
In C, a multi-dimensional array is an array that has more than one dimension. The most common type of multi-dimensional array is a two-dimensional array, but C also supports arrays with three or more dimensions.
dataType arrayName[dimension1Size][dimension2Size]...[dimensionNSize];
int matrix[3][4];
int matrix[3][4] = { {1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12} };
int element = matrix[1][2]; // Row 1, Column 2 (indices start from 0)
int threeDArray[2][3][4];
And so on for higher dimensions.