EmbLogic's Blog

Why C is showing c+2 after coming back form the macro call…???

#include
#define max(a,c,b) a=(b>c)?b:c
void max1(int,int,int);
int main()
{
int a=1,c=5,b=4;
max(a,c++,b++);//It will make b=5 and c=7.. ??
printf(“By Macro %d\n”,a);
printf(“now a= %d\nb= %d\nc=%d\n”,a,b,c);
max1(a,b++,c++);
return 0;
}
void max1(int a,int b,int c)
{
a=(b>c)?b:c;
printf(“%d \n”,a);
}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>