0
Why can't we use float value in switch statement
switch(4.2) // Why is this not valid?
1 Resposta
0
First you don't use 'switch()' that way because you're supposed to put a variable not a raw input. And second floats are imprecise so you cannot use them in 'switch()' but as i know there is a few tricks to by pass that.