Machine-translated by Google. Questions are authored in English.
Top

Discussion

Choose the correct statements

  • A.Strictly speaking C supports 1-dimensional arrays only
  • B.An array element may be an array by itself
  • C.Array elements need not occupy contiguous memory locations
  • D.Both (a) and (b)

Answer: D

Correct answer: Both (a) and (b)

(a) is true: C really has only one-dimensional arrays - int a[3][4] is an array of 3 objects, each of type int[4]. (b) says the same thing from the other side: an element may itself be an array. The third statement is false; elements are always contiguous, which is exactly what makes subscripting work.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.