Created
March 29, 2010 22:42
-
-
Save mwbrooks/348509 to your computer and use it in GitHub Desktop.
This file contains 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
// Uncomment to disable assertions. | |
// NDEBUG macro must be defined before #include <assert.h> | |
// #define NDEBUG | |
#include <assert.h> | |
int main (int argc, char * const argv[]) { | |
int *goodInteger = new int(2); | |
int *badInteger = NULL; | |
assert(true); // pass | |
assert(false); // fail | |
assert(goodInteger); // pass | |
assert(badInteger); // fail | |
delete goodInteger; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment