Hello, cplusplus.com
I made an C++ header named "math.h", and it just solve an simple expression. I don't get any errors, but when I enter an expression, the program stops working.
Your simple_expr() function needs to return a double. Specifically, line 49 ends the function yet has no return.
Also, it'd probably be better if you used a single stack for the RPN for the entire program. Every computation, just pop the elements off the stack, perform the operation, then push the result back. Just ensure there's only 1 element left at the end of the expression.
Your logic appears to be flawed in that you seem to be expecting the user to enter the entire expression at once, but when you use the extraction operator on cin you will only parse one word at a time.
If that is your intent, then, as i like red pandas said you need to return something after line 49. In your case, you probably want to return a NaN, but then you have to check in your main function that your result is valid.
We'll be better able to help you if you explain exactly what type of input your calculator is supposed to take.
The math_stack num_stack; of line 45 is lost from expression to expression as it is an automatic variable, and is created with each call. Pass it in by reference from main() to keep it persistent during the life of the execution.
At the bottom of perform_operation you need to push the result back onto stack for correct operation.
Sorry, but I don't speak english (I'm brasillian), but I haven't found where is the error. Can you (please, remember, I don't understand you 100%) "fix" it and show me the code?