PDA

View Full Version : Boolean limitations


Akeem
29/06/2018, 03:26 PM
Can i use 0 insteady of false in a boolean?

Lokii
29/06/2018, 03:29 PM
No, whats the problem with true and false i know 0 and 1 is less typing but not by much.

Akeem
29/06/2018, 03:33 PM
Is it adviced to call if(ploggined == false).
Because i use it like this if(ploggined == 0).

Lokii
29/06/2018, 03:48 PM
Is it adviced to call if(ploggined == false).
Because i use it like this if(ploggined == 0).

You can do this for both bool and int and its also less typing:


if(!ploggined) //is like ploggined == false and for int like ploggined == 0
if(ploggined) //is like ploggined != false and for int like ploggined != 0