for loop without index declaration

前端 未结 5 1346
误落风尘
误落风尘 2021-01-24 00:11

So I declare a variable some where and initialize it. Now later on I need to use it to loop while its still positive so I need to decrement it. To me looping using a condition a

5条回答
  •  说谎
    说谎 (楼主)
    2021-01-24 00:52

    In my opinion, this is a proper way to go. You might work with iterators that are able to move both forward and backward, but this doesn't necessarily all value to your code.

提交回复
热议问题