Fill This Form To Receive Instant Help
Homework answers / question archive / Why would a programmer intentionally code the following line into a program? #define true 1 while(true) { // Stuff inside loop
Why would a programmer intentionally code the following line into a program?
#define true 1
while(true)
{
// Stuff inside loop.
}
Since this snippet would always be executed, as true=true will always return a true, the programmer may code it into a program to introduce intentional time delay. The time taken to execute the stuff inside the loop would add delay to the running of the lines of code after the loop, which may be so desired by the requirements of the program.