In the C language there is no predefined primitives for the boolean values
true and
false. Instead, the integer 0 is interpreted as
false and any other integer is interpreted as
true. So, if you have the above code (with stdq's modification) it should work nicely in any C compiler. It wouldn't just work with that value though; here are a few that would also work:
- int flag = 42;
-
while(flag) {}
or
- int flag = 1337;
-
while(flag) {}
Or try this:
- int flag = ++9000;
-
while(flag) {}
It should work too.
You can even go the other way around and actually calculate the result of an expression which you know will be true, such as
- int flag = (7 == 7);
-
while(flag) {}
or
- int flag = ! (1 > 2);
-
while(flag) {}
Here,
true is always converted to 1 and
false always to 0.