In: Computer Science
For a given two-dimensional array in C as follows (Each int-type element occupies 4 bytes of memory)
int A[8][16];
If the address of A[1][4] is 0x0FFA0040, what is the memory address of A[2][6]?
A[1][4] is 0x0FFA0040 our address starts from here Each int-type
element occupies 4 bytes of memory so we hace to add 4 bytes
conitues untill reach A[2][6]
A[1][5] is 0x0FFA0044 add 4 bytes we get this
A[1][6] is 0x0FFA0048 add 4 bytes we get this
A[1][7] is 0x0FFA004c now add 4 bytes to 8 it will 12 in decimal
but here address in hex so it is C
A[1][8] is 0x0FFA0050
A[1][9] is 0x0FFA0054
A[1][10] is 0x0FFA0058
A[1][11] is 0x0FFA005c
A[1][12] is 0x0FFA0060
A[1][13] is 0x0FFA0064
A[1][14] is 0x0FFA0068
A[1][15] is 0x0FFA006c
A[2][0] is 0x0FFA0070
A[2][1] is 0x0FFA0074
A[2][2] is 0x0FFA0078
A[2][3] is 0x0FFA007c
A[2][4] is 0x0FFA0080
A[2][5] is 0x0FFA0084
A[2][6] is 0x0FFA008c
//if we do this continues we will reach our desied location whose
address is 0x0FFA008c
If you have any query regarding the answer please ask me in the
comment i am here for help you. Please do not direct thumbs down
just ask if you have any query. And if you like my work then please
appreciates with up vote. Thank You.