Search code examples
c++boolean-logicboolean-expression

Error in while((Status.health !0) && (Wolves.health !0) ) expected expression ")"


Hey i have an error in this:

while((Status.health !0) && (Wolves.health !0) )

Can anyone see what is wrong with this ?


Solution

  • It's syntactically incorrect.

    Assuming you want to verify that the variables are not equal to zero:

    while((Status.health != 0) && (Wolves.health != 0) )