在上一篇随笔中已经知道如何将中缀表达式转换为后缀表达式,那么如何由后缀表达式计算出值呢?
//操作数栈 typedef struct { int data[MAXSIZE]; int top; } ST; ST st; //计算后缀表达式的值 int compvalue(char postexp[]) { st.top=-1; int d=0; int i=0,j=0; char ch = postexp[i]; while(ch!='