how to separate debug and release mode code

Posted by john on Stack Overflow See other posts from Stack Overflow or by john
Published on 2010-03-24T15:00:55Z Indexed on 2010/03/24 15:03 UTC
Read the original article Hit count: 221

Filed under:
|
|
|
|

during debug mode or while i am doing testing, i need to print lost of various information, so i use this method

ifdef TESTING

// code with lots of debugging info

else

// clean code only

endif // TESTING`

Is this the good method, or is there any other simple and elegant method. But this way, I am repating the same code in two places and if anything is to be changed later on in the code, I have to do it in both places, which is time consuming and error prone. Thanks.

I am using MS Visual Studio.

© Stack Overflow or respective owner

Related posts about debugging

Related posts about visual-studio-2005