String Token? or String Arrays?

Ok there seem to be MANY approaches to this question, but I decided to ask the C++ Forums for help!

Read from the input stream an arithmetic expression that contains
- Nonnegative int's
- Variables consisting of lower case, single, alphabetic characters.
- Parentheses
- Arithmetic operators

A ; will be used to denote the end of the expression. I need to beable to encode each token above and store them as a list. Then beable to pull them out of the list and print them the same way they came in. Spaces must be neglected.

Ex. Input
x =3+ (b/5 ) ;

Output
x = 3 + (b / 5)

I understand what i would do logically, but I'm having a hard time getting off the ground... mainly reading in the expression and storing each token in a list and then pulling them back out, other than that i can handle how to write the rest. Help :)

Topic archived. No new replies allowed.