Macros in C can be dangerous if used sloppily.

If I remove the () from the excellent example above, we can prove that 2*2 = 3 !

#define inc_macro(x) x+1

main()
{

printf("%d\n",inc_macro(1)*inc_macro(1));
}

% gcc macrotest.c
% a.out
3

The reason for this is that it expands to:

printf("%d"\n",x+1*x+1);
which due to order of operations is the same as x+(1*x)+1 or 1+(1*1)+1.

This is why it is a good idea to include () around your expression in a #define.

An alternative in C that does not have this problem is the inline function.