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

Discussion

C does no automatic array bound checking. This is best described as 

  • A.True
  • B.False
  • C.C's asset
  • D.C's shortcoming

Answer: D

Correct answer: C's shortcoming

C performs no bounds check, so an out-of-range subscript silently reads or writes memory that belongs to something else. It is generally counted a shortcoming: it is the root of buffer overflows and of a great many hard-to-find bugs. The design was deliberate - omitting the check keeps array access as fast as raw address arithmetic - but the cost in safety is the reason later languages put the check back.

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

Post your comment

Please log in or register to post a comment.