这个地址(0x00000400) = 1024怎么办

发布于 2024-09-18 11:32:51 字数 165 浏览 5 评论 0原文

我使用 C++ 工作,并且有一个 #define VAL 0x00000400。当我设置一个等于定义的变量时: int value = VAL;当我运行调试器时显示变量值 = 1024。有人可以解释它如何变成 1024 吗?也许有一些指向内存地址信息、#define 信息或相关内容的链接。

Im working in C++ and I have a #define VAL 0x00000400. when I set a variable equal to the define: int value = VAL; when I run through the debugger is shows the variable value = 1024. could someone explain how that turns into 1024? Maybe some links to memory address info, #define info, or something relevant.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

物价感观 2024-09-25 11:32:51

0x00000400 是 1024 的基数 16。调试器将向您显示基数 10 的整数值。

0x00000400 is base 16 for 1024. Your debugger is showing you the integer value in base 10.

一直在等你来 2024-09-25 11:32:51

“0x400”是十六进制,或基数16。0x400表示为十进制(基数10),是1024.

顺便说一句,你可以用google来做base转换。搜索“十进制的 0x400”,Google 就会给你答案。

"0x400" is hexadecimal, or base 16. 0x400 expressed as decimal (base 10), is 1024.

By the way, you can use google to do base conversions. Search for "0x400 in decimal" and google will give you the answer.

东走西顾 2024-09-25 11:32:51

0x00000400 是 400 以 16 为基数,也就是 1024 以 10 为基数。

0x00000400 is 400 base 16, which is 1024 base 10.

情深如许 2024-09-25 11:32:51

十进制 1024 = 十六进制 400。

1024 in decimal = 400 in hex.

懵少女 2024-09-25 11:32:51

0x400 是一个十六进制数(由 0x 前缀表示)。它是表示十进制数 1024 的另一种方式。

0x400 is a hexadecimal number (indicated by the 0x prefix.) It is another way of representing the decimal number 1024.

∞梦里开花 2024-09-25 11:32:51

此外,从 0x400(基数 16)到基数 10 的转换为:

4*16^2 + 0*16^1 + 0*16^0
4*16^2 + 0 + 0
4*256
1024

Additionally, the conversion from 0x400 (base 16) to base 10 is:

4*16^2 + 0*16^1 + 0*16^0
4*16^2 + 0 + 0
4*256
1024
心房的律动 2024-09-25 11:32:51

好吧,我还没有看到你的代码,但是 400h = 1024 十进制并且你指定整数 ' int value = VAL ' 编译器只是不显示任何通知/警告,它会为你进行转换

well, I haven't seen your code, but 400h = 1024 decimal and you specify integer ' int value = VAL ' compiler just does not display any notice/warning, it does the cast for you

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文