我是如何用C ++编写的 [英] How I write this in C ++

查看:84
本文介绍了我是如何用C ++编写的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是新来的。

我正在学习用c ++编写代码。



怎么写这个c ++:



Hello, i am new here.
I am learning to write code in c ++.

how to write this in c ++ :

MOV ECX, OFFSET BYTE_BCAD72
CALL SUB_4ABCGA





我尝试过:





What I have tried:

<pre>MOV ECX, OFFSET BYTE_BCAD72
CALL SUB_4ABCGA

推荐答案

你要使用 __ asm __ asm __ 取决于你的编译器



说过,不是 BYTE_BCAD72 SUB_4ABCGA 符号将在您的代码中定义,因此它可能无法执行您想要的操作,并且 ECX 也会被删除...
you'd use __asm or __asm__ depending on your compiler

having said that, neither BYTE_BCAD72 or SUB_4ABCGA symbols would be defined in your code, so it probably wouldn't do what you wanted anyway, and ECX would be trashed too ...


引用:

如何写这个c ++:

你没有,因为这两行没有意义。



正确学习C ++



这是参考书籍的链接由语言的作者在C和C ++上。注意,C是C ++的祖先,所以知道C对C ++总是有用。

C编程语言 - 维基百科,免费的百科全书 [ ^ ]

https://hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2。 pdf [ ^ ]

http://www.ime.usp。 br / ~pf / Kernighan-Ritchie / C-Programming-Ebook.pdf [ ^ ]



C ++编程语言 [ ^ ]

You don't, because these 2 lines have no meaning.

Learn properly C++

Here is links to references books on C and C++ by the authors of the languages. Note than C is the ancestor of C++, so knowing C is always useful with C++.
The C Programming Language - Wikipedia, the free encyclopedia[^]
https://hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2.pdf[^]
http://www.ime.usp.br/~pf/Kernighan-Ritchie/C-Programming-Ebook.pdf[^]

C++ Programing Language[^]


这两行代码是汇编语言,而不是C语言的任何版本。这是C / C ++编译的东西。



这两行代码没有围绕它们的更大代码块,代码就毫无意义。没有办法将这些代码行转换为C ++。您必须评估它们所在的代码,然后编写与整个块等效的C ++代码。
Those two lines of code are assembly language, not any version of C. This is the kind of stuff that C/C++ compiles down to.

These two lines of code are meaningless without the much larger block of code around them. There is no way to "convert" those lines of code to C++. You have to evaluate the code that they are in and then write C++ code equivalent to the entire block, if possible.


这篇关于我是如何用C ++编写的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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