The problem starts after the line
Code:
cin >> op1 >> operation >> op2;
in main. The next line should invoke apply like this
Code:
total = apply(operation );
And also should the apply-function look a little different. Change each case statement to return the result like
Code:
case '+': return (op1 + op2);
//break;
case '-': return (op1 - op2);
//break;
case '*': return (op1 * op2);
//break;
case '/': return op1 / op2;
//break;
default:
cerr << "You selected an invalid operation!" << endl;
return 0;//Cases little trouble because an arithmetric operation can return 0
All break(s) are unnessesary in this case because the function exits after a return statement. And the last problem is..... I´ll leave it to you to find it