Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


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

Computer Science

Why would a programmer intentionally code the following line into a program?

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

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Answer Preview

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.

Related Questions