You generally want to have a stack, with each token popped on it as it's read.
But I recommend writing a calculator in Bison instead of pure c++. It's easier. Here's an example.
You generally want to have a stack, with each token popped on it as it's read.
But I recommend writing a calculator in Bison instead of pure c++. It's easier. Here's an example.
It is too clear and so it is hard to see.
A dunce once searched for fire with a lighted lantern.
Had he known what fire was,
He could have cooked his rice much sooner.