Arsench Arsench - 8 months ago 58
C++ Question

C++ input value process as math function

I’m very new in C++ and I need your help. I want to use the input value as a mathematical function then print the result.

What i need is:

When user input: 2 +1 and hit Enter then output (cout>>)
should be your result is: 3 (the sum of 2 + 1)

The mathematical symbol could be + or * or / or -.

Could you please help me with some example?

Thanks in advance!


Search about "Reverse Polish notation" and implementation in C++