Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ VS2010 determine if Release or Debug

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.

like image 568
tmighty Avatar asked Mar 31 '13 09:03

tmighty


Video Answer


1 Answers

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
like image 134
masoud Avatar answered Oct 01 '22 01:10

masoud