给消防员更多帮助 [英] More help for a fireman

查看:87
本文介绍了给消防员更多帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是运行我的消防站警报系统的程序的代码。它会读取来到我们打印机的数据包,并向我们发出关于应该到期的信息的警报。我所拥有的两个问题是它随时崩溃是收到它不理解的数据包,也是当我从计算机上运行互联网时运行的。它还存储捕获的数据包,因此我必须返回并删除它们。我试图让这个消防员证明,因为我可以很少维护。任何人都有任何想法

Below is the code for the program that runs my firehouses alerting system. It reads packets that come to our printer and gives us an audible alert on what piece is due. The two issuse I have with it are that it crashes anytime is receives a packet it doesnt understand and also when I access the internet from the computer its running on. It also stores captured packets so I have to go back and delete them. Im trying to make this a fireman proof as I can so there is very little maintenance. Anyone have any ideas

展开 | 选择 | Wrap | 行号

推荐答案

我只浏览了所有代码(它真的是太多的代码要发布在这里)我不知道这些变量a,e,eb,md等来自哪里,即它们不是全局变量所以应该在该函数中声明它们。 br />

通常你的编译器会告诉你未定义(未声明的)变量。阅读其错误诊断消息并逐一修复。


亲切的问候,


Jos
I only skimmed through all that code (it really is too much code to post here) and I don''t know where these variables a, e, eb, md etc. come from, i.e. they''re not global variables so they should be declared somewere in that function.

Normally your compiler will tell you about undefined (undeclared) variables. Read its error diagnostic messages and fix them one by one.

kind regards,

Jos


我对代码的长度表示歉意。变量e,eb,a,m,hc,hsc;是车站的不同单位。 E =发动机,A =救护车等等。我下次应该把代码作为附件吗?我再次道歉,我还在学习。
My apologies on the length of the code. The variables e,eb, a, m, hc, hsc; are the different units in the station. E=engine, A=ambulance and so forth. Should I put the code as an attachment next time? Again i apologize im still learning.


@pgfdbug


无需道歉;根据经验,人们应该发布 SSCCE 。大多数时候制作SSCCE使潜在的海报在发布前解决了他/她自己的问题:-)


关于你的问题:我们都知道这些变量的语义是什么,即你知道他们的意思。编译器并不那么聪明;所有它看到的都是一个名为''a'的东西然后它抛出:它没有看到声明,也没有看到那个东西的定义所以编译器不知道它能用它做什么,所以它开始呜呜;这就是编译器的方式。他们不像人类那样宽容,他们对意义或语义一无所知。他们只是简单的愚蠢。


亲切的问候,


Jos
@pgfdbug
No need to apologize; as a rule of thumb people should post an SSCCE. Most of the time crafting an SSCCE makes the potential poster solve his/her own problem even before posting it :-)

About your problem: we both know what the semantics of those variables are, i.e. you know what they mean. A compiler isn''t so smart; all it sees is something named ''a'' and then it throws up: it hasn''t seen a declaration, nor a definition of that thing so the compiler doesn''t know what it can do with it, so it starts whining; that''s the way compilers are. They are not as forgiving as humans and they don''t know anything about ''meaning'', or ''semantics''. They''re just plain stupid.

kind regards,

Jos


这篇关于给消防员更多帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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