POV-Ray : Newsgroups : povray.off-topic : Teach yourself C++ in 21 days : Re: Days 1-5 Server Time
30 Jul 2024 00:22:05 EDT (-0400)
  Re: Days 1-5  
From: Invisible
Date: 20 Apr 2012 03:55:20
Message: <4f911668@news.povray.org>
>>>> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.