+ 2
Why cant the switch functiom take non integer values
eg: string option; switch(option) { it kept showing switch quantity non integer value
3 Antworten
+ 1
And to add to the Gordie's answer, floats can't be precisely compared for equality. And switch uses just the equality comparisons.
As for the strings, they are complex types, comparing strings is a whole function and can't be translated to a CPU command.
+ 1
so I have to use if for multiple choice