Logo

Programming-Idioms

History of Idiom 2 > diff from v66 to v67

Edit summary for version 67 by :
Admin deletes impl 2375: This impl is not idiomatic, and error-prone

Version 66

2019-03-26, 20:14:44

Version 67

2019-03-26, 20:15:26

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Illustration

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Illustration
Code
for(int i=10;--i;printf("Hello\n"));
Comments bubble
Only available in C99 or later. Uses only 1 for loop