Cloud Stack Ninja

My assert does not stop the program from continuing on. I do not have NDEBUG defined as I've seen from other questions on this matter. Can anyone explain why?

#include <iostream>
#include <assert.h>

int main()
{
   assert(0==1);
   std::cout << "Execution continues past the first assert" << std::endl;
   return 0;
}

Edit: I am using VS2019

Edit2: Thanks Arthur - as some have mentioned it looks like NDEBUG is defined somewhere. Is there a way to undefine this?



Read more here: https://stackoverflow.com/questions/64396083/why-does-my-assertion-not-raise-an-error

Content Attribution

This content was originally published by Namtropa at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: