How to escape while control structure with implement of switch case

does not check that "key" is valid!. It say if key equals the numeric value of the boolean TRUE enter the "then" part of the if statement!

Actually, it says that if key is not 0 (which is the value of NO_KEY), then, do stuff. Any key will result in the stuff being done.

Not that I like that style, mind you. I prefer explicit tests myself. Except in the case of pointers.