fork download
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <assert.h>
  4.  
  5. #ifdef NDEBUG
  6. #define my_assert(condition) ((void)0)
  7. #else
  8. #define my_assert(condition) \
  9. do { \
  10. if(!(condition)) { \
  11. printf("assertion failed: %s, at %s(%d)\n", #condition, __FILE__, __LINE__); \
  12. abort(); \
  13. } \
  14. } while(0)
  15. #endif // my_assert
  16.  
  17. int main(void)
  18. {
  19. my_assert(!"hakin fyi");
  20. return 0;
  21. }
Runtime error #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
assertion failed: !"hakin fyi", at prog.cpp(19)