i was testing it out but i keep getting error "switch quantity not an integer".
does this mean i can't use switch with string? if there any way to do this? i really don't want to use if else statements.
Well you could create an enum in your main code (eg: enum variables{'-'=0,'+'=1,...}) and then just comment the enum assignments in the switch statement for readability.
Switch accepts anything which default-promotes to an integer value, including an enum.
You cannot name enumerated values with character literals. An enumerated value must be identifiers, just like every other value name in your program...
...Which leads back to the original problem: how to select based upon a string value? I've given you two answers.
To involve an enum is only useful if you plan to use them as magic values which are used in multiple places in your program. Otherwise it is overhead.