Idiomatic C can look a bit strange to new coders. void foo() { for (;;) {} } Thi...
MOS_8502 @mos_8502@studio8502.ca
Idiomatic C can look a bit strange to new coders.
void foo()
{
for (;;) {}
}
This for construct is shorthand for "do nothing, over and over again, forever." Why is this ever useful? Let's say your program is not driven by a conventional main() function, but by hardware interrupts; those interrupts will break the CPU out of the loop and run your custom code, but you still need something for the CPU to do in between IRQ handlers.