请教下断言(assertion)的作用及使用场合
昨天调一个简单的程序时提示错'Debug Assertion Failed',关于那个程序出现这个错误的原因已经弄懂了(原贴是:http://community.csdn.net/Expert/topic/3184/3184803.xml?temp=.6714441)
想再请教下关于断言的作用及使用场合,谢谢!
//////////////////////////
///MSDN中的相关说明
assert
Evaluates an expression and when the result is FALSE, prints a diagnostic message and aborts the program.
void assert( int expression );
不知道这个东西在实际应用中是否会使用?