while(10) is the same as while(1) or any other symbolic constant.
It means that the loop runs forever.
You usually see this in a menu driver:
- int choice;
-
while(1)
-
{
-
-
choice = getChoice();
-
switch (choice)
-
{
-
case 1:
-
..this is menu choice 1...
-
break;
-
case 2:
-
.. this is menu choice 2..
-
break;
-
default:
-
...this is a bad choice..
-
}
-
}
-
}
The program will stay in this loop for all choices. Hopefully, of choice is to exit the program or you are going to be here a looonnnggg time.