C/assert: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Lethern (dyskusja | edycje)
→‎Przykład: poprawki
Linia 20:
 
===Przykład===
<source lang="c">
 
#include <assert.h>
int main()
{
int err=1;
assert(err==0);
return 0;
}
</source>
 
Program wypisze komunikat podobny do:
Assertion failed: err==0, file test.c, line 6
 
Natomiast jeśli uruchomimy:
<source lang="c">
#define NDEBUG
#include <assert.h>
int main()
{
int err=1;
assert(err==0);
return 0;
}
</source>
 
nie pojawi się żaden komunikat o błędach.