On 2/8/07, Tamas Marki <[EMAIL PROTECTED]> wrote:

On 2/8/07, Nagaraj M <[EMAIL PROTECTED]> wrote:
> The if condition getting true because 5 is aggigned to
>  i, i.e. non-zero value is assigned in if condition.
>  The c compiler takes it as if(1).

Not quite.
The result of an assignment is the assigned value,


Which is implicitly casted to a boolean - in this case 1. If you wanted to
be pendantic, you could have pointed out that it isn't the compiler that
treats it as if(1), but the runtime executable.

in this example it
will be 5, so if you'd do
if (i = 0)
then the condition would fail.


That's what they implied.


--
PJH

#706281 +(1868)- [X]
TriPod11: bush ain't THAT bad...he kinda knows what he's doin
idaredbeet08: Please, Monica Lewenski had more President in her than George
Bush ever will.

Reply via email to