[comp.lang.c] ? and = do not go hand-in-hand

csp@gtenmc.UUCP (03/30/91)

To someone with a macro problem :-

The problem is not with the 'macro'.

funct(a,b,c,d)
float a,b,c,d;
{
   return( d == 0 ? a = 0 , b = c : ( a = c / d , b = c - a * d ));
				    ^
   This bracket is nescessary otherwise the scope of the '?' operator is
 upto '=' after the ':' and not including it. Since assignment has a lower
 precedence than the '?' operator.

 In short the attempt is to assign a value to a value which is senseless.

}

C S Palkar
--