Share
Explore BrainMass

Why Infinite Loop

Why would a programmer intentionally code the following line into a program? (Code needed to make this a complete program intentionally left out.)

#define true 1
while(true)
{
// Stuff inside loop.
}

Solution Preview

"Why would a programmer intentionally code the following line into a program?"
- For instance when a program needs to prompt the user for an operation (from a menu) this kind of loops are used. Or an embedded system checks ...

$2.19