Question: Consider the following C code: main ( ) { int A [ 2 ] [ 2 ] [ 3 ] ; int i , j
Consider the following C code:
main
int A;
int ijkx;
x;
for k; k; k
for j; j; j
for i; i; i
x;
Aijk x;
x;
when row major is used
A A A A A A A A A A A A
when column major is used
A A A A A A A A A A A A
Consider the consecutive blocks of memory given above on the right, where each block can keep an integer value. Assuming that A is stored in the first block, give the elements of the array A that will be stored in these consecutive blocks, together with their value, just before the statement x is executed.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
