Clifton M. Bean wrote in
news:hp****************@newssvr24.news.prodigy.com :
In C++ within Visual Studio as well as within UNIX ...
I need to turn off/on debug statements. I do not want to comment out
these statements.
I am guessing that I can use:
#ifdef DEBUG
.... statements ...
#endif
I use DEBUG as an identifier.
Where should I define this identifier? Can it be done within a
makefile for UNIX? Or in some text field in Project Settings in
Visual Studio 6 Environment?
.... or is this there a better way?
define NDEBUG on the compilers comand line -DNDEBUG (*) this has
the advantage that it will turn off the assert() macro from <cassert>.
In your development enviroment you will have to find the the correct
place to make such a define.
For things not covered by assert() use:
#ifndef NDEBUG
// debugging code here
#endif
or if you like to type alot:
#if !defined( NDEBUG )
// debugging code here
#endif
(*) Not all compilers will use this syntax (just most :), check
your compilers documentation.
Rob.
--
http://www.victim-prime.dsl.pipex.com/