[assert _ASSERT]CRT assertion

我只是一个虾纸丫 提交于 2020-04-04 21:49:55

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.  

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!