:: Re: [DNG] Icerbergs aren't small ju…
Top Pagina
Delete this message
Reply to this message
Auteur: Rainer Weikusat
Datum:  
Aan: dng
Onderwerp: Re: [DNG] Icerbergs aren't small just because they're mostly underwater
Didier Kryn <kryn@???> writes:

[...]

>> A multi-line version could look like this:
>>
>> while (c = *r) {
>>     ++r;
>>          if (c == '/') n = r;
>> }

>>
>
>     It might be done with a for loop.  eg:

>
>     for ( ; *r ; ++r) if(*r=='/') n=r;
> n++;


[...]

> The for loop is the best construct for a loop with an incremental
> cursor.


That's nicely exemplified by the fact that the code above does a
redundant increment (or did a redundant increment would it work, the {}
are missing) solely to work around the fact that the "for loop
mechanics" of checking the condition before the loop body is executed
and performing a "variable increment step" afterwards are ill-suited to
this particular problem ...