The Formula to calculate the address of an element in 2-d array using Row Major Order would be-: Arr( A[i][j])=BA+[i*n+j]*w where, BA-: Base Address w-: width [ data type of array] i-: subscript of array element j-: subscript of array element n-: number of column m-: number of rows Q- Find address of element in array having location a[2][3] with base address 100 and it is an integer type array,and the size of array is a[3][4]? => we know that, Arr( A[i][j])=BA+[i*n+j]*w here, a[2][3]=100+[2*4+3]*2 a[2][3]=100+[8+3]*2 a[2][3]=100+22 a[2][3]=122. The Formula to calculate the address of an element in 2-d array using Column Major Order ...
" The Techprogramiz is a computer science portal for C language. It contains well written, well thought and well explained C programming articles,basic to advance level"