444 views
0 votes
0 votes
  1. Main()
  2. {
  3. unsigned int x[4][3]={{1,2,3},{4,5,6},{7,8,9},{10,11,12}};
  4. printf("%u %u %u",x+3,*(x+3),*(x+2)+3);
  5. }

A) 2036,2036,2036

b)2012,4,2204

c)2036,10,10

d)2012,4,6

1 Answer

0 votes
0 votes
Answer will be A.I think in question they will give base adress 2000 and each int takes 4 bytes based on that info I will explain

Here x ={x1,x2,x3,x4} Assuming each inside variable is a one dimension array

x+3 means it points to x3  so before that we have two arrays each with 3 integers so 2000 +  2* 3* 4  + 4(bcz it is pointing x3) = 2036

*(x+3) also same address because it is pointing first integer in X3 array that is x3[0] and we know both x3 and x3[0] address same so 2036.

*(x+2) +3 means first *(x+2) means pointing to x2[0] then we are moving 3 integers(and in x2 we have 3 integers) i.e we are pointing to x3 first integer which is 2036

No related questions found