precedence tpush(char* arr, precedence token)
{
arr[++top] = token;
}
precedence tpop(char* arr)
{
char symbol;
int n = 0;
precedence result;
if (is_empty(arr))
printf(" EMPTY ");
else
{
result = getToken(stack, &symbol, &n);;
arr[--top];
return result;
}
}
void postfix(char* stack)
{
char symbol;
precedence token;
int n = 0;
int top = 0;
stack1[0] = eos;
for (token = getToken(stack, &symbol, &n); token != eos; token = getToken(stack, &symbol, &n))
{
if (token == operand)
push(stack1, token);
else if (token == rparen)
{
while (expr[top] != lparen)
printf("%c", tpop(stack));
tpop(stack);
}
else
{
while (isp[stack[top]] >= icp[token])
{
push(stack1, token);
tpop(stack);
printf("%c", tpop(stack));
}
tpush(stack, token);
}
}
while ((token = tpop(stack1)) != eos)
printf("%c", token);
printf("\n");
}
여기에 CL.EXE가 종료된다는 오류가 뜰곳이있어?? 난 중괄호도 다 채워넣어줬는데 나한테 왜그래진짜 눈물날거강아ㅜ마ㅓ듀라ㅗㅈ듀러ㅗㅂ듀라ㅗ뷰라ㅗㅂ듀
개고수노