int square(int x) { return x * x; }
#define square(x) ((x) * (x))
[dywang@dyw219 zzz]$ vim preprocess5.c [dywang@dyw219 zzz]$ cat preprocess5.c #include <stdio.h> #define MAX(x,y) ((x) > (y) ? (x) : (y)) int main(void) { printf("Max between 20 and 10 is %d\n", MAX(10, 20)); return 0; }
[dywang@dyw219 zzz]$ gcc -o preprocess5 preprocess5.c
[dywang@dyw219 zzz]$ ./preprocess5 Max between 20 and 10 is 20