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

You are viewing a single comment's thread from:

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

in programming •  8 years ago 

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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!