Martin Ambuhl wrote:
> Derk Gwen wrote:
>
>> "OZ" <> wrote:
>> # how to run the index with 1, 2, 2,3,4,5..... in an array from a do
>> loop ?
>>
>> for (i=1; i<=n; i++) {loop statements}
>
>
> That doesn't repeat the value 2 for i, now does it?
>
It doesn't replicate the typo, no.
(Was that a typo? Or is the OP just trying to do something really odd?
The post isn't clear.)
So, assuming the OP wasn't mistaken in his post, I'll make an attempt:
/* An enclosing translation unit */
i = 1;
/* use i at 1 */
i = 2;
/* use i at 2 */
/* use it again, for whatever reason... */
for (i = 3; ; i++) { /* assuming an inifinte loop here */
/* use i at 3, 4, 5, ... */
}
/* finish translation unit */
There. That code is bug-for-bug compatible with the woefully inadequate
specification.

I don't vouch for its efficiency, but I do believe it
to be correct (or as correct as the specification is). I hope the OP can
make some use out of it.
--
My address is yvoregnevna gjragl-guerr gjb-gubhfnaq guerr ng lnubb qbg pbz
Note: Rot13 and convert spelled-out numbers to numerical equivalents.