This post is from a low-reputation account and contains an unverified outbound link. Be cautious before clicking external links.
RE: RE: C++ Programming ( Simple Calculator Code)♦♦♦♦
You are viewing a single comment's thread from:

RE: C++ Programming ( Simple Calculator Code)♦♦♦♦

Words
98
Reading
1 min
Listen
Play
9y

To expand on your idea you might have to look at operator precedence and introduce a virtual stack to handle the operands and operators.

Ive used the reverse polish notation to handle converting infix to postfix for a similar calc/eval project in assembler. Using RPN allows you to specify other custom operators, like functions for string handling: concatenation, uppercase, stringtoval and logical operations and even possible including bitwise operations.

Wikipedia has a good entry on RPN using infix to postfix, and a breakdown of the steps that are used to calculate some examples: https://en.wikipedia.org/wiki/Reverse_Polish_notation

Keep up the good work

@mrfearless: To expand on | Ecency