Hello I need to figure this out, I tried

if ((Fire = 0) || (Water = 0) || (Air = 0) || (Earth = 0))

But the compiler says I cant use && for ints, I need to get a value for each variable and
have certain outputs for different combinations of numbers.

Basically if all are 0 then something happens, if fire is 1 and water is 6 and the rest are 0 something happens etc. I can figure the rest out I just need to work around this &&


Recommended Answers

You need to check equality with "==". "=" is for assignment.

Jump to Post

All 3 Replies

You need to check equality with "==". "=" is for assignment.

:S Stupid mistake, thanks!

My "mentor" always put the constant on the left side of the equal sign so that would never happen (starting back in the C days).

if(0 == Fire)

That way, if you leave off an equal sign, the compiler will catch it.
Yes, of course, if you can remember to reverse the arguments, you can remember to use == . :)
...or use the .equals() method on objects

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.