assert 函数输出的诊断Diagnostic Printed by the assert Function

ANSI 4.2 assert 函数输出的诊断和终止行为ANSI 4.2 The diagnostic printed by and the termination behavior of the assert function

如果表达式为 false (0),则 assert 函数将输出诊断消息并调用 abort 例程。The assert function prints a diagnostic message and calls the abort routine if the expression is false (0). 诊断消息具有以下形式The diagnostic message has the form

Assertion failed: expression, file filename, line linenumberAssertion failed: expression, file filename, line linenumber

其中,filename 是源文件的名称,linenumber 是源文件中失败的断言的行号。where filename is the name of the source file and linenumber is the line number of the assertion that failed in the source file. 如果表达式为 true(非零),则不执行任何操作。No action is taken if expression is true (nonzero).

另请参阅See Also

库函数Library Functions