Logo

Programming-Idioms

History of Idiom 50 > diff from v4 to v5

Edit summary for version 5 by :

Version 4

2015-08-19, 14:01:32

Version 5

2015-08-20, 10:53:52

Idiom #50 Make an infinite loop

Write a loop which has no end clause.

Idiom #50 Make an infinite loop

Write a loop which has no end clause.

Imports
#define forever while(1)
Code
while(1)
{
}

while(1);

forever
{
}

forever;
Comments bubble
With and without block, both is possible.

forever can be defined as a preprocessor constant to improve readability.