Reputation: 11419
I would like to check in C++ 2010 if the build is running as Debug or Release. Is there a simple way to check that?
Thank you.
Upvotes: 7
Views: 6567
Reputation: 56549
VisualStudio generates _DEBUG
and NDEBUG
as a define
. You can check it at compile time.
#ifdef _DEBUG
// THE CODE IS COMPILING IN DEBUG MODE.
#endif
Upvotes: 17