While (n-> 0) with while (--N> = 0)

zhaozj2021-02-08  333

Circulating n times, in addition to the most commonly used for (INT i = 0; i 0) {...} and while --N> = 0) {...}. The difference between these two ways is that if n is a unsigned type, then the following writing will result in Infinite Loop. Today, I was bitten by this small bug :) I also blame myself to be lazy, don't love to write for loops.

转载请注明原文地址:https://www.9cbs.com/read-127.html

New Post(0)