Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) NDEBUG

 

#define NDEBUG to let the preprocessor remove all asserts from your code.

 

The code below has a failing assert, but due to NDEBUG it will not abort the program. Commonly, one #defines NDEBUG after debugging.

 

#define NDEBUG
#include <cassert>

int main()
{
  assert(1==2); //Nonsense
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict