in one-dimensional arrayswe have seen that the computer does not keep track of the address of every element in the array it stores only the address of the first element and calculates the address of other elements from the base address (address of the first elementsame is the case with two-dimensional array here alsothe computer stores the base addressand the address of the other elements is calculated using the following formula if the array elements are stored in column major orderaddress( [ ][ ]base_address { ( )and if the array elements are stored in row major orderaddress( [ ][ ]base_address { ( )where is the number of bytes required to store one elementn is the number of columnsm is the number of rowsand and are the subscripts of the array element example consider two-dimensional array marks which has its base address and the size of an element now compute the address of the elementmarks[ ] assuming that the elements are stored in row major order solution address( [ ][ ]base_address { ( ( )address(marks[ ][ ] { ( ( ) { ( ( initializing two-dimensional arrays like in the case of other variablesdeclaring two-dimensional array only reserves space for the array in the memory no values are stored in it two-dimensional array is initialized in the same way as one-dimensional array is initialized for exampleint marks[ ][ ]={ }note that the initialization of two-dimensional array is done row by row the above statement can also be written asint marks[ ][ ]={{ , , },{ }}the above two-dimensional array has two rows and three columns firstthe elements in the first row are initialized and then the elements of the second row are initialized thereforemarks[ ][ marks[ ][ marks[ ][ marks[ ][ marks[ ][ marks[ ][ in the above exampleeach row is defined as one-dimensional array of three elements that are enclosed in braces note that the commas are used to separate the elements in the row as well as to separate the elements of two rows in case of one-dimensional arrayswe have discussed that if the array is completely initializedwe may omit the size of the array the same concept can be applied to two-dimensional arrayexcept that only the size of the first dimension can be omitted thereforethe declaration statement given below is valid int marks[][ ]={{ , , },{ }}in order to initialize the entire two-dimensional array to zerossimply specify the first value as zero that isint marks[ ][ { }