Different code paths for DEBUG and RELEASE builds

I'm using MS Visual C++ V6.0 and want to print messages to stdout for Debug builds and not for Release builds. Does VC++ set a flag or define a macro or something for the different builds that I can use?

e.g.

#ifdef DEBUG
printf(....)
#endif

Thanks

Comments

  • : I'm using MS Visual C++ V6.0 and want to print messages to stdout
    : for Debug builds and not for Release builds. Does VC++ set a flag or
    : define a macro or something for the different builds that I can use?
    :
    : e.g.
    :
    : #ifdef DEBUG
    : printf(....)
    : #endif
    :
    : Thanks

    [color=Blue]
    DEBUG is with underscore, like so:
    [/color]
    [code]
    #ifdef _DEBUG
    printf (....)
    #endif
    [/code]
  • Thanks very much. I thought it had to be something like that.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories