将中缀转换为后缀 [英] convert infix to postfix

查看:62
本文介绍了将中缀转换为后缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在为这个计划工作!现在我被困住了,因为我一直得到一个语法错误消息,而且我只是看不到

编译器发出的信号!

i''ve been working on this program forever! now i''m stuck and going
insane because i keep getting a syntax error msg and i just can''t see
what the compiler is signaling to!

展开 | 选择 | Wrap | 行号

推荐答案

好吧我终于修复了错误!但程序输出操作符和

数字,没有变量


例如:如果我输入* b + c * d / 2,它给出** 2 / +


现在怎么样?

ok i finally fixed the error!!! but the program outputs operators and
numbers, no variables

for example: if i input a*b+c*d/2 , it gives **2/+

so what now?


caramel写道:
caramel wrote:
我得到的错误信息是:语法错误之前切换

我不明白:S ...有什么建议吗?
the error msg i get is: syntax error before "switch"

i don''t get it :S ... any suggestions?




switch语句应该在哪个函数中?


-

pete



Which function is the switch statement supposed to be in?

--
pete




pete写道:

pete wrote:
caramel写道:
caramel wrote:
我得到的错误消息是:语法错误之前 ;切换

我没有得到它:S ...有什么建议吗?
the error msg i get is: syntax error before "switch"

i don''t get it :S ... any suggestions?



switch语句应该在哪个函数?

-



Which function is the switch statement supposed to be in?

--



开关在void convertToPostfix(char infix [],char postfix [])

我想要什么知道的是哪里是''c''。我试图追踪

计划状态,但却找不到它的位置。你似乎没有把它作为一个论点传递给你。同时刷新stdin会导致不明确的行为,请将

表示出来。


the switch is in void convertToPostfix(char infix[], char postfix[])
what i want to know is where is ''c''. i''ve attempted to trace the
program state and can''t find out where it is. You don''t seem to pass it
as an argument. Also flushing stdin causes undefined behaviour, take
that out.


这篇关于将中缀转换为后缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆