calculate input text

Hi.
How can I calculate some input text like below?
"23*4-54/3"
What sould I use? Recursion or Stack?
What is ending condition?

Thanks
Is this for a class assignment? If so, I'd use whatever you find the most manageable to code. You will have to parse the text for the operators and maintain precedence. Other than that pretty straight forward. Start one step at a time.
I don't know how to start.
What are the steps?
How to declare precedence? This become harder when () comes into play :(
Can you read in a line of text, that would be a good place to start.
Can you parse the string, seperating the numerics from the operators (even if that parsing means nothing at all, can you at least look at each character and tell if xxx is a 3 digit number or y is an operator?)
Yes I can do that.
I can parse input and put its tokens in an array of strings.
Topic archived. No new replies allowed.