POV-Ray : Newsgroups : povray.programming : Re: chi2.cpp : Re: chi2.cpp Server Time
6 Oct 2024 13:02:08 EDT (-0400)
  Re: chi2.cpp  
From: Thorsten Froehlich
Date: 7 Dec 2002 13:32:06
Message: <3df23ea6$1@news.povray.org>
In article <3df2361b@news.povray.org> , "Tony[B]" <ben### [at] catholicorg> 
wrote:

>> BTW, gotos are fine, they are just a bit harder to read in their "natural"
>> form.  However, you use them all the time - in form of the switch-case
>> statement.
>
> Interesting. And would if-else statements not do that too?

No, a "case" is always a goto with exactly the same abilities as a "natural"
goto!  You may for example write the following perfectly legal code:

int i = 4;
switch(2)
{
    case 1:
        i = 7;
        while(i < 6)
        {
            if(i != 4)
            {
    case 2:
                i++;
            }
        }
        printf("%d", i);
}

Guess what this prints...

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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