+ 3

What is While(true)?

What is while(true) loop and how can we use it, Explain me with an example

17th Dec 2020, 4:22 PM
Gouse Basha
Gouse Basha - avatar
2 Respuestas
+ 1
It is indeed a infinited loop. It is either intended to run forever, or some where in the loop there is code inside that breaks out of the loop. https://code.sololearn.com/c4jJbh0uclyd/?ref=app Also have a look at this link. https://www.tutorialsteacher.com/csharp/csharp-while-loop
17th Dec 2020, 5:24 PM
sneeze
sneeze - avatar
+ 1
it is infinity -- loop forever... a bad example (for win32, C): #include <windows.h> int main() { while (1) { MessageBox(NULL, "You've been hacked!", "Error!", MB_ICONERROR); } return 0; }
17th Dec 2020, 4:40 PM
Flash