Im trying to create a calculator program that simply separates the values of a string into numbers and symbols such as -+*/ etc. I'm having problems trying to updating two stacks that are sent from main to the method split() and back to main to where all the changes that occur in split() occur in the main stacks also. Any help would be amazing.
I don't see what your problem is. I didn't check if that function actually does what you want, but it certainly operates on the stack that you haves passed it.
Maybe you should split the function up a little - for example, write a separate function to discard whitespace, to extract a token from a string, and to check whether a token is a number or an operator (or a parenthesis). And I don't know what kind of expression you are expecting, but unless you are working on terms that are fully encloses in parentheses you will have to consider the priority of an operator as well.
I found out the problem in an earlier part of my code. Apparently i was using a cin instead of a getline() function to change my str string so my str string was what was messed up and not the stacks. Thank you for helping.