// define_debug.cc // for g++ compiled with: // g++ -DDEBUG -o define_debug define_debug.cc // -DDEBUG is equivalent to the source #define DEBUG // If we recompile without -DDEBUG then the debug test // below will not run #include using namespace std; int main() { #ifdef DEBUG cout << "I'm doing a debug test now." << endl; #endif cout << "Hello, world" << endl; }