fork download
  1. /* assert example */
  2. #include <stdio.h> /* printf */
  3. #include <assert.h> /* assert */
  4.  
  5. void print_number(int* myInt) {
  6. assert (myInt!=NULL);
  7. printf ("%d\n",*myInt);
  8. }
  9.  
  10. int main ()
  11. {
  12. int a=10;
  13. int * b = NULL;
  14. int * c = NULL;
  15.  
  16. b=&a;
  17.  
  18. print_number (b);
  19. print_number (c);
  20.  
  21. return 0;
  22. }
Runtime error #stdin #stdout #stderr 0s 3276KB
stdin
Standard input is empty
stdout
10
stderr
prog: prog.cpp:6: void print_number(int*): Assertion `myInt!=__null' failed.