int getmax(int a, int b)
{
return a>b?a:b;
}
is better than
#define getmax(a, b) ((a)>(b)?(a):(b))
Because consider doing
getmax(a++,b++);
With define macro you get
((a++)>(b++)?(a++):(b++));
And this is propably not what you want.