How about:
for (unsigned i = n ; i-- > 0 ; )
{
// do stuff with i
}
More Related Contents:
- C: Why is counter not resetting to 0 in for loop [closed]
- What is my C code not printing # in staircase pattern, this is from hackerrank, I did not pass all test cases, but i can't point out why?
- How many times will “Hello World” be printed?
- I need help understanding this code in C [closed]
- optimized sum of an array of doubles in C [duplicate]
- Variable redeclaration in c in loop and outside loop?
- Understanding Simple For Loop Code in C [closed]
- What is the difference between ++i and i++?
- Why does the order of the loops affect performance when iterating over a 2D array?
- For vs. while in C programming?
- Effect of semicolon after ‘for’ loop
- C: for loop int initial declaration
- Which ordering of nested loops for iterating over a 2D array is more efficient [duplicate]
- What is the full “for” loop syntax in C?
- How do I fix “for loop initial declaration used outside C99 mode” GCC error?
- What does a ‘for’ loop without curly braces do?
- Two semicolons inside a for-loop parentheses
- C for loop indexing: is forward-indexing faster in new CPUs?
- When implementing an infinite loop, is there a difference in using while(1) vs for(;;) vs goto (in C)?
- Why is int rather than unsigned int used for C and C++ for loops?
- C For loop skips first iteration and bogus number from loop scanf
- With arrays, why is it the case that a[5] == 5[a]?
- How to increment a pointer address and pointer’s value?
- Measure time in Linux – time vs clock vs getrusage vs clock_gettime vs gettimeofday vs timespec_get?
- Why must the variable used to hold getchar’s return value be declared as int?
- Are literal strings and function return values lvalues or rvalues?
- x86_64 ASM – maximum bytes for an instruction?
- How is this const being used?
- Is int main() { } (without “void”) valid and portable in ISO C?
- Understanding htonl() and ntohl()