M
mthread
Hi,
I am new to C++, But has good experience in C. In C I have used
macros to enable / disable debug statements in the code. For ex :
#if defined ENABLE_DEBUG
#define Printf1(arg) printf(arg)
#else
#define Printf1(arg)
#endif
int main()
{
Printf1("This is a debug statement\n");
}
By defining/not-defining ENABLE_DEBUG I can enable / disable the debug
statements.
I would like to know what is the kind of standard used in C++ to
enable / disable the debug statements(ie cout statements).
I am new to C++, But has good experience in C. In C I have used
macros to enable / disable debug statements in the code. For ex :
#if defined ENABLE_DEBUG
#define Printf1(arg) printf(arg)
#else
#define Printf1(arg)
#endif
int main()
{
Printf1("This is a debug statement\n");
}
By defining/not-defining ENABLE_DEBUG I can enable / disable the debug
statements.
I would like to know what is the kind of standard used in C++ to
enable / disable the debug statements(ie cout statements).