#include #include #define DEFINITION_1 #ifdef TRIGGER #undef DEFINITION_1 #endif #ifdef DEFINITION_1 #define MFUNC(n) n*n*n #define CHUNK1 z = #define CHUNK2 % 5; #define TEXT 5/2 #define double int #define REALTHING 1.0 inline void test(double d){ if(d%2){ cout << d << " is odd\n"; } else { cout << d << " is even\n"; } } #elif TRIGGER2 #define MFUNC(n) n*-2 #define CHUNK1 z=fabs( #define CHUNK2 ) - 1; #define TEXT 1001 #define REALTHING 2.0 inline void test(double d){ if((int)d%2){ cout << d << " is odd\n"; } else { cout << d << " is even\n"; } } #else #define MFUNC(n) "A beautiful day in the neighbourhood: " << n #define CHUNK1 cout << #define CHUNK2 << "\n"; #define TEXT 99; #define REALTHING 3.0 inline void test(double d){ cout << "Won't you be my neighbour?\n"; } #endif typedef float COKE; void drink(COKE c) { for (COKE i = 0.0; i < c; i++){ cout << "Glug... "; } cout << "\n"; } int main() { double z = TEXT; COKE classic = REALTHING; drink(classic); cout << "z starts as " << z << "\n"; CHUNK1 MFUNC(z) CHUNK2 cout << "z is now " << z << "\n"; test(z); }