After putting efforts i was unable to solve the following question. Question was asked in Graduate Aptitude Test in Engineering (GATE) 2014, India.
Question) For a C program accessing X[i][j][k], the following intermediate code is generated by a compiler. Assume that the size of an integer is 32 bits and size of the character is 8 bits.
t0 = i * 1024
t1 = j * 32
t2 = k * 4
t3 = t1 + t0
t4 = t3 + t2
t5 = X[t4]
Which one of the following statements about the source code for the C program is CORRECT?
(a) X is declared as "int X[32][32][8]".
(b) X is declared as "int X[4][1024][32]".
(c) X is declared as "int X[4][32][8]".
(d) X is declared as "int X[32][16][2]".
One of the book which provide solutions to the previous papers says that the answer is option (a). How? Any explanation
Thanks in advance
int?