The basic difference is that functions are compiled whereas macros are preprocessed. When you use a function call it will be translated into ASM CALL with all these stack operations to pass parameters and return values. When you use a MACRO, C preprocessor will translate all strings using macro, do the necessary replacement and than compile.
See the following example
#define square(x) x*x
int square1(int x)
{
return x*x;
}
main()
{
printf("Macro output - %d\n", square(2+2));
printf("Function output - %d\n", square1(2+2));
}
Macro output - 8
Function output - 16
Now in case 1 square(2+2) is replaced with 2+2*2+2 and then code is compiled which gives output 8 and in case 2 square1(2+2) 2+2 is calculated at the compile time and passed to the function...