The assert macro part of the C standard library is a mechanism to aid in writing less buggy code. It allows you to “assert” that some condition must be true in order to continue. This chapter covers the assert macro, a sample implementation, assertions vs. errors and exceptions, use in production code, and advice for using assertions.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Assertions

  • Paul J. Lucas

摘要

The assert macro part of the C standard library is a mechanism to aid in writing less buggy code. It allows you to “assert” that some condition must be true in order to continue. This chapter covers the assert macro, a sample implementation, assertions vs. errors and exceptions, use in production code, and advice for using assertions.