>>>> while (x[i] = y[i--]) ;
>>>
>>>> is perfectly valid. You sick, sick people.
>>>
>>> I think that's Undefined Behavior because the same variable is being
>>> modified and referenced more than once in the same expression.
>>>
>>
>> Nothing undefined here.
>
> Does it compare x[i] to y[i] or to y[i-1]? Why do you answer that way?
Last time I checked, the /comparison/ operator is ==.
The = operator performs *assignment*. :-P
(Assuming that neither x[] nor y[] contains any zero bytes, presumably
this is also an infinite loop...)
Post a reply to this message
|