Error: deque iterator not dereferenceable

前端 未结 3 1466
予麋鹿
予麋鹿 2021-01-20 05:07

I\'m trying to create a program that converts an arithmetic expression from infix to postfix form. As long as I don\'t call the \"infixToPostFix\" function, the program runs

3条回答
  •  清歌不尽
    2021-01-20 05:52

    You are calling top on empty stack, just follow the code for your test.

    1. you start with an empty stack
    2. you encounter a VALUE, you don't change stack
    3. you encounter an OPERATOR and attempt to access stack.top()

提交回复
热议问题