I need to understand how this code works:
#define foo1( a ) (a * a) // How does this work? inline int foo2(
Well, it's really simple.
foo1( 1 + 2 )
will turn into:
( 1 + 2 * 1 + 2 )
which is actually:
1 + 2 + 2 = 5
This is how macros work.