I need to compare an int in a switch statement, and I’m unsure of how I’m typing it wrong. Here’s my code:
switch (y) {
case int y isgreater(1, 411):
// case code here...
To simplify what I want, in VB, the code would be:
Case >= 411:
'Code here for case
C-based languages like Objective-C don’t support that sort of syntax. Just use an
ifstatement:In a
switchstatement, eachcasevalue must be a discrete constant.