+ 3
What is While(true)?
What is while(true) loop and how can we use it, Explain me with an example
2 ответов
+ 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
+ 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;
}