Does #ifdef _DEBUG
in the main function has any sense if I am working on visual studio 2013 ?
If yes, what it is for ?
int _tmain(int argc, _TCHAR* argv[])
{
#ifdef _DEBUG
//creating some objects, using functions etc;
#endif
}
#ifdef DEBUG
or #ifdef _DEBUG
are used to handle some code that you use for debugging purposes. If you add #undef _DEBUG
or similar to this at the very beginning of your code, the compiler will skip the code contained in #ifdef DEBUG /* bla bla */ #endif
.
If you're
//creating some objects, using functions etc;
inside this block and thinking this will work, I assure you, it won't until you include -D_DEBUG
in compiler's options during invocation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With