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

Discussion

Which macro can be used to detect and report exceptional conditions?

  • A.extern
  • B.EDOM
  • C.assert
  • D.LDBL_MIN

Answer: C

Correct answer: assert

assert(expr) tests a condition that ought to be true and, if it is not, reports the expression, file and line and aborts. It is for catching programming errors during development, not for handling conditions a correct program might meet - and defining NDEBUG removes every assertion from the build.

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

Post your comment

Please log in or register to post a comment.