for (unsigned int i = N; i --> 0;) printf("%d\n", i);
This --> construction also works in JavaScript and so on.
while (N --> 0) { ... }
for (unsigned int i = N; i--;){} unsigned int i = N; while(i--){ ... }
for (unsigned int i = N - 1; i > 0; i--){ ... }
And we cannot change the comparison to `>=` in the later, because unsigned is always bigger or equal 0, thus we would get infinite loop.
unsigned char x = 0; do { printf("%d\n", x); } while (++x);
unsigned int x = 0; const unsigned int max = ~x; while (x <= max) { calc(x++); }
#include <limits.h> const unsigned int max = UINT_MAX;
while (1) { calc(x++); }
unsigned int x = 0; while (x < ~x) { calc(x++); }
unsigned int x = ~0; while (x > ~x) { calc(x--); }
for (unsigned int i = N; i --> 0;) printf("%d\n", i);
This --> construction also works in JavaScript and so on.