S
sinbad
is it possible to pass variable no.of arguments to a macro ...
#define print(a,b) printf(a,b)
void main()
{
int a=1,b=2,c=3;
print("%d %d %d",(a,b,c));
}
the problem in the above code is the expression (a,b,c) evaluates to c
,
and only the value of c will get printed.
#define print(a,b) printf(a,b)
void main()
{
int a=1,b=2,c=3;
print("%d %d %d",(a,b,c));
}
the problem in the above code is the expression (a,b,c) evaluates to c
,
and only the value of c will get printed.