Help, one line of my code is doing my head in, im trying to make an IF statement for humidity between 60 and 65.
my code is;
if ((int)humidity < 65) && ((int)humidity > 60)
I keep getting this error, I m sure ive fixed this before
if ((int)humidity < 65); && ((int)humidity > 60); { // Ok Humidity - Do nothing
^
exit status 1
Compilation error: expected identifier before '(' token
PaulRB
2
Try
if (((int)humidity < 65) && ((int)humidity > 60))
But, why the (int) ? Doesn't seem necessary.
Hey Paul,
I have no idea, im making this up as i go along. Half the code came from other people
PaulRB
4
Error, ok...
So did my suggestion fix the error?
PaulRB
5
Wait a minute...
if ((int)humidity < 65) && ((int)humidity > 60)
Where did that ; come from?
yes it did thanks, Im not sure where that came from lol
ive been awake for 18 hours now
PaulRB
7
Yeah... The one thing that fixes more coding errors than anything else is... 8 hours of good sleep.
PaulRB
8
if (humidity < 65 && humidity > 60)
should also work and is much simpler.
system
Closed
9
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.