I've seen code where a condition is evaluated based on an int variable instead of bool.
int condition
cin >> condition;
if (!condition)
//do something
I know that C++ supports that 0 is false and 1 is true, but is this safe code? Is it supported by all C++ compilers as a standard?
Could it also be a bad practice considering that you might switch to another language and find out that this kind of code isn't supported?
I mean, is it good practice at all?