Created
April 3, 2022 17:53
-
-
Save hidsh/f5751b8cbb216d3879a9cb226ee13321 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <assert.h> | |
int x = 10; | |
int main(void) | |
{ | |
assert(x < 5); | |
printf("assert test\n"); | |
return 0; | |
} | |
/* | |
❯❯❯ gcc assert-test.c && ./a.out | |
Assertion failed: (x < 5), function main, file assert-test.c, line 9. | |
[1] 3665 abort ./a.out | |
❯❯❯ gcc -DNDEBUG assert-test.c && ./a.out | |
assert test | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment