Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • C++
while (true) {
	// Do something
}

You may remove the curly braces if the block is only 1 instruction.

The compiler might warn you that the loop expression is never false.

Warning: infinite loop without side-effects is undefined behaviour.
for (;;) {
	/// Do something
}

You may remove the curly braces if the block is only 1 instruction.

Warning: infinite loop without side-effects is undefined behaviour.
loop
   null;
end loop;

null; means "do nothing"

New implementation...
< >
programming-idioms.org