You are viewing a single comment's thread from:

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

in #programming7 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

Coin Marketplace

STEEM 0.20
TRX 0.12
JST 0.028
BTC 65355.67
ETH 3525.27
USDT 1.00
SBD 2.47