/* testDB2.cpp * * Test debugging class. * * Bruce M. Bolden * August 25, 1998 */ #include #include "debug.h" // prototypes void func1(); void func2(); int func3(); Debug *db = new Debug; int main() { func1(); db->DebugOff(); // turn debugging off func1(); db->DebugOn(); // turn debugging on func2(); db->DebugOff(); func2(); db->DebugOn(); func2(); for( int i = 0 ; i < 5 ; i++ ) { db->Debug( "Value from func3(): ", func3() ); } return EXIT_SUCCESS; // 0 on older compilers } void func1() { db->Debug( "In func1()" ); } void func2() { static int iCount = 0; // static variable db->Debug( "In func2()" ); db->Debug( "iCount: ", iCount ); iCount++; } int func3() { static int iCount = 0; // static variable return iCount++; }