code question

Hi all,
There is something I don't understand in this code, what is while (true). I mean there is no bool , so what does it check to be true or false ?
// Finicky Counter
// Demonstrates break and continue statements
#include <iostream>
using namespace std;
int main()
{
int count = 0;
while (true)
{
count += 1;
//end loop if count is greater than 10
if (count > 10)
{
break;
}
//skip the number 5
if (count == 5)
{
continue;
}
cout << count << endl;
}
return 0;
}
THANKS FOR YOUR PATIENCE
the while(true) statement is equivalent to while(1) ... a forever while loop
Last edited on
Topic archived. No new replies allowed.