#define MAX(A,B) ((A) > (B) ? (A) : (B))
Then
x=MAX(p+q,r+s);
expands to
x=((p+q) > (r+s) ? (p+q) : (r+s))
#define SQUARE(X) X*X
SQUARE(z+1)
expands to
z+1*z+1
#if??? ?????????
<code to be compiled if #if is non-0>
#endif
prompt> gcc -DDEBUG -o MyProgram.out MyProgram.cHere the value is assumed to be 1. The setting of such flags is useful, especially for debugging. You can put commands like:
x = y *3;
#ifdef DEBUG
printf("Debugging: Variables (x,y) = %d %d",x,y);
#endif
#define cc(A,B,C) (A)?(B):(C)