怎么才能用上assert?
标准C++宝典里的程序,在BCB 6下,到assert那就跳出来了,要怎么设置啊。是在fulldebug模式下。
#include <iostream>
#include <cassert>
using namespace std;
void Display(char * p);
int main(int argc, char* argv[])
{
char * pChar = 0;
Display(pChar);
int n;
cin>>n;
return 0;
}
//---------------------------------------------------------------------------
void Display(char * p)
{
assert(p != 0);
cout<<p<<endl;
}