Hey, I'm typing up some code for a class assignment, and i'm attempting to utilize a switch statement, but I receive the seen error when I try to compile. Any help?
install gentoo
>>56487374
this tb.h
>>56487374
we need to use dr. java for the course
>>56487332
You (will) have an F. Be ashamed.
use doublequotes fuckhead
>>56487332
Fp is an int and you are switching its values in char quotes? Literally what the fuck?
>case 'x == y'
>defult
You might want to read about the switch statements again
>>56487426
No kek, it's an int not a string fucking tardbo, no quotes at all. OP you can't do any of what you're trying to do. Even if you didn't have quotes you are switching a true/false value thats actually an int
>>56487426
scratch that, why the fuck do you have quotes at all. Your error is because you're using single quotes (for characters such as 'a' and 'b' for a string "which should be in double quotes") but you're not even checking whether the string is equal to that.
Each line you're checking
is Fp equal to 'Fp <= A' which it isn't, it's a fucking integer, not a character or string.
>>56487448
been doing the class for 3 weeks, first exposure. Please advise?
>>56487332
Switch can't do that. This is how you use switch:switch (1)
{
case 1: break;
case 2: break;
}
In your case you have to use an if.if (Fp <= A)
{
}
else if (Fp <= B)
{
}
...
>>56487484
You can only check for equality, not greater-or-equal with a switch statement.
>>56487517
Now get the fuck out of here and don`t come back you pathetic piece of shit