Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //converts infix expression to postfix expression
- void ArithmeticExpression::convertToPostfix(char *const inFix, char *const postFix)
- {
- //create a stack2 object named cow
- Stack2<char> cow;
- cout<<postFix;
- char thing = '(';
- //push a left parenthesis onto the stack
- cow.push(thing);
- //append a right parenthesis to the end of inFix array
- strcat(inFix, ")");
- int i = 0;//declare an int that will control posFix position
- //if the stack is not empty
- if (!cow.isEmpty())
- {
- //loop to run until the last character in inFix array
- for (int x = 0; inFix[x]!= '