If the user input a equation something like 2 + 2 * 2 + ( 2 - 2) infix expression.
how i collect the data to stack?
using string?
someone can give the algorithm.
I don't have idea to get the input.
Jakiro
0
Newbie Poster
Recommended Answers
Jump to PostVisualize each number and each operator in the input string to be a token. Then, if each token is separated from the next by a space you can use >> to get each token into separate strings. If ()s are allowed, then typically they aren't separated from the numerical input …
All 4 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.