#how can int hunger = true;

14 messages · Page 1 of 1 (latest)

tidal fractal
#

Hey I was just wondering how an int can be true, I thought only booleans can be true or false

lilac prismBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

maiden valley
tidal fractal
#

so int hunger = true; it just means that hunger = 1?

maiden valley
#

ints can be converted to bools too

#

if the int is zero you get false

#

for everything else, you get true

tidal fractal
#

that would be (bool) hunger am I correct?

maiden valley
tidal fractal
#

Okay thanks for the help :D

maiden valley
#

the full list of available implicit conversions is long, this should be enough for you for now

tidal fractal
#

alr thx

#

!solved