|
|
back to boardassert function Posted by Madhav 13 Jun 2008 04:49 assert function doesn't work here. for the program i used assert.it failed there was no response #include<iostream> #include<cassert> using namespace std; int main(){ assert(0==1); return 0; } the above program must result in a statement program aborted.But instead the program gives WA Re: assert function assert() function outputs a message and ends the program with nonzero return code. Of course, the Judge interprets such behaviour as wrong answer. Re: assert function It is not "of course" becase other online judges (and real ACM contest servers) treat non-zero return as runtime error. I usually abort with #define FAIL *(int*)0 = 0 causes CRASH runtime error |
|
|