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

Discussion

What is the maximum number of dimensions an array in C may have?

  • A.Two
  • B.Eight
  • C.Twenty
  • D.Theoretically no limit. The only practical limits are memory size and compilers

Answer: D

Correct answer: Theoretically no limit. The only practical limits are memory size and compilers

The standard fixes no maximum number of dimensions; it only requires an implementation to support a certain depth of declarator nesting. So the limit is practical - how much memory the array would need, and how deeply the compiler will nest. Note that memory grows as the product of the bounds, so even four modest dimensions can exhaust it.

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

Post your comment

Please log in or register to post a comment.