how to convert character into operator code example
Example: how to convert character into operator
int Compute(char c, int a, int b)
{
switch (c) {
case '+': return a+b;
case '-': return a-b;
case '*': return a*b;
case '/': return a/b;
default: throw std::runtime_error("No such operator");
}
}