[assert _ASSERT]CRT assertion

CRT provides a set of debug routines for helping debugging issues. About assertion, it provides two:

1. _ASSERT. This macro will only evaluate the expression and pop up diagnostic dialog if assert fails. It's only available when _DEBUG defined.

2. assert. This macro will evaluate the expression and pop up diagnostic dialog if assert fails, and further call Abort to break the application. It's available for both release and debug builds. Defining NDEBUG can remove it away.

MSDN:

The assert routine is available in both the release and debug versions of the C run-time libraries. Two other assertion macros, _ASSERT and _ASSERTE, are also available, but they only evaluate the expressions passed to them when the _DEBUG flag has been defined.  

原文地址:https://www.cnblogs.com/taoxu0903/p/1894430.html