Function must have integral or unscoped enum type?

Fairly certain this is common to receive, but everytime I try to find someone with this error I find them getting the same error but with different events, so I don't know how to apply it to what is going on here, so sorry if this has been solved and I just haven't been able to find it yet. Anyways, heres the code.

void SetEnemyDamage(float DamageVarX, float DamageVarY, float DamageVarZ, float level)
{

if (level >= 1 && level <= 10)
{
enemydamage = (DamageVarX * DamageVarY)*(DamageVarZ / DamageVarX);
}
else if (level >= 11 && level <= 25)
{
enemydamage = (DamageVarX*(DamageVarZ) * DamageVarY) + ((2.0 ^ (level - DamageVarY)) / DamageVarZ);
}
else
{
enemydamage = (DamageVarX*DamageVarY) + (level*DamageVarZ);
}
}
this happens at 2.0^(level right at the parenthesis. Been looking through it and see no other issues, so I'm not sure exactly what to do.
(2.0 ^ (level - DamageVarY)
It should be :

(pow(2.0, (level - DamageVarY))

The header <cmath> is required.

Last edited on
It's worth mentioning that the carat ^ is binary exclusive-OR, not exponentiation.
Topic archived. No new replies allowed.