If the user input a equation something like 2 + 2 * 2 + ( 2 - 2) infix expression.
how i collect the data to stack?
someone can give the algorithm.
I don't have idea to get the input.
Jump to Post
Visualize 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 RepliesReply 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.