I can\'t figure out how to use switches in combination with an enum. Could you please tell me what I\'m doing wrong, and how to fix it? I have to use an enum to make a basic
In case you don't want to use return statement for each case, try this:
Calculate(int left, int right, Operator op)
{
int result = 0;
switch(op)
{
case Operator.PLUS:
{
result = left + right;;
}
break;
....
}
return result;
}