Does anyone know how to write a boolean flag and can you break it down to me? please and thank you i am just 11 learning so thing can get hard.
I think you're referring to "booleans", or "bool" for short. Bools can only be of 2 types,
false. They are used for when variables signify a on/off condition. They are also used in conditions and program flow.
bool isLightSwitchOn = true; bool isSquidSmart = false;
Bools also get implicitly converted to 1s and 0s. That means behind the scenes, the compiler secretly changes all
true values to
1, and all
false values to 0. That's why if you print out
true, you'll get 1. That also means that
1 are exactly the same, so are