J
junky_fellow
Hi guys,
I have a piece of code:
int func(int flag)
{
int number=1;
if (flag == 1)
return 0;
if(flag == 2)
if( number == 1)
return 0;
else
return number;
return(number);
}
I want to replace this function with a macro.
int main(void)
{
int result;
int flag = 0;
result = func(flag);
}
I tried using nested conditional operator convert the function to
macro, but end
up with some problems.
Can anybody please help me on this ??
thanks in advance for your help ....
I have a piece of code:
int func(int flag)
{
int number=1;
if (flag == 1)
return 0;
if(flag == 2)
if( number == 1)
return 0;
else
return number;
return(number);
}
I want to replace this function with a macro.
int main(void)
{
int result;
int flag = 0;
result = func(flag);
}
I tried using nested conditional operator convert the function to
macro, but end
up with some problems.
Can anybody please help me on this ??
thanks in advance for your help ....