Question : postfix expression evaluator

I need help writing a program in either c++ or c# that can evaluate a postfix expression that is read from a text file and uses spaces or operators as seperators between integers. integers will only be positive and the only operators is +,-,* and /

Answer : postfix expression evaluator

First create a set of tokens.

The easiest way to parse (most of the other MVPs will probably tell you this is a bad technique) is to use strtok to break up the input string, using space as a separator.  

Initially assume that you are not going to get any syntax errors and that the user will input all values correctly and they will only input integers.

Using the first character,  convert the string into a token.  If it is a digit, convert it to a number.   Try that to start with, see how you get on.

If you manage it then try floating point numbers.
Random Solutions  
 
programming4us programming4us