[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Help

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 15
Thread images: 1

File: hw.png (140KB, 1920x1080px) Image search: [Google]
hw.png
140KB, 1920x1080px
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)
{
// print
}
else if (Fp <= B)
{
// print
}
...
>>
>>56487484

You can only check for equality, not greater-or-equal with a switch statement.
>>
>>56487502
ty
>>
>>56487517
Now get the fuck out of here and don`t come back you pathetic piece of shit
Thread posts: 15
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.