/* compile using: gcc -E ex02.c */ /* and: gcc -E -D DEBUG_MODE ex02.c */ #define M 100 #define K 400 + Q #define SQUARE(X) (X) * (X) #define Q 4 #define SWAP(TYPE, A, B) { TYPE tmp=A; A=B; B=tmp;} /* example #2 */ #include int main() { int x = M; int y = SQUARE( K ); SWAP( int, x, y ); double q = 4.56; #ifdef DEBUG_MODE printf( "x is %d and y is %d and q is %lf\n", x, y, q ); #endif return 0; }