Arsench Arsench - 1 year ago 147
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!

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download