VC ++中的代码说明 [英] Code Description in VC++

查看:63
本文介绍了VC ++中的代码说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是VC ++的新手.DLL文件是用VC ++(MFCDLL)开发的.Dll的邮件目的是在COM端口中读写文件".我不知道此Code的含义[Code is :buffer [0]!= 27]?谢谢您的关注.
问候,
Lakshmi Narayanan.S

Hi,
I am new for VC++.The DLL file is developed in VC++ (MFCDLL).The mail purpose of Dll is "Read and write a file in the COM Port".I don''t know what is meaning of this Code [Code is :buffer[0] != 27]?Thanks for your Attention.
Regards,
Lakshmi Narayanan.S

推荐答案

刚接触C ++的人们应该在做类,而不是在现实世界的代码上工作,或者是任何人都想使用的代码. DLL,COM端口,这些都是高于基本C ++语法思想的几个难点.最让我沮丧的是,这样的代码会让您感到困惑,因为这样的代码会让您感到困惑,并向我们提出这样的问题.

缓冲区是一个数组,可能是字符. 0是数组中第一项的索引.当您有!=时,它必须是一个if语句,它将检查数组中的第一个值是否不是27.请不要以为我告诉您这意味着您在远程能够在与COM端口交互的C ++ DLL上工作,但您显然不是.如果您想学习C ++,请购买初学者的书并通读它.通过在这里提出这样的问题,您将不会学到,至少不会远程学习.不管我们能为您的项目提供多少帮助,如果您不了解这些基础知识,最终结果仍将是可怕的,并且您理解它的几率将很低.
People who are new to C++ should be doing classes, not working on real world code, or code that anyone would ever think to use. DLLs, COM ports, these are all things several orders of difficulty above the idea of basic C++ syntax. What depresses me most is the idea that odds are decent you''re being paid to be confused by this code and ask us this sort of question.

buffer is an array, probably of characters. 0 is the index of the first item in the array. As you have a !=, it must be an if statement, it''s checking if the first value in the array is not 27. Please don''t take the fact that I told you this to mean that you''re remotely capable of working on a C++ DLL that interacts with the COM port, you clearly are not. Buy a beginners book and work through it if you want to learn C++. You won''t learn it, at least not remotely well, by asking questions like this here. No matter how much we can help you get your project to run, if you don''t understand these basics, the end result will still be horrible, and the odds of you understanding it will be low.


27是转义字符(一个经常使用的控制字符)的ASCII值. http://en.wikipedia.org/wiki/ANSI_escape_code [
27 is the ASCII value for the Escape character, a much used control character. http://en.wikipedia.org/wiki/ANSI_escape_code[^]


这篇关于VC ++中的代码说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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