将地址指向指针

编程入门 行业动态 更新时间:2024-10-19 19:44:11
本文介绍了将地址指向指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在以下代码中: 不安全的等级X { byte * _address; void test() { _address =(byte *)144220152; } } 为什么监视窗口显示_address变量的不同地址 ?

In the following code: unsafe class X { byte* _address; void test() { _address=(byte*)144220152; } } Why the watch windows shows a differtent address for _address variable ?

推荐答案

Vlad, 你确定你没有看到 数字的十六进制格式吗?它是否会显示8989FF8(这是十六进制中的相同值 格式)? 希望这会有所帮助。 - - - Nicholas Paldino [.NET / C#MVP] - mv * @ spam.guard.caspershouse " Vlad" <一个********* @ gmail>。在消息中写道 news:11 ********************** @ o13g2000cwo.googlegr oups ... Vlad, Are you sure you are not looking at the hexidecimal format for the number? Does it show you 8989FF8 instead (this is the same value in hex format)? Hope this helps. -- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse "Vlad" <a.*********@gmail> wrote in message news:11**********************@o13g2000cwo.googlegr oups... 在下面的代码中: 不安全的类X { byte * _address; void test() { _address =(byte *)144220152; } 为什么监视窗口显示_address变量的不同地址? In the following code: unsafe class X { byte* _address; void test() { _address=(byte*)144220152; } } Why the watch windows shows a differtent address for _address variable ?

感谢您的帮助,但问题不是十六进制格式 Thanks for your help, but the problem isn''t hexidecimal format

Vlad, 好​​吧,我将_address字段和测试方法更改为公共,然后 然后在运行测试后将_address的值写入控制台。 的值是相同的。 必须有其他更改它的东西,但代码中没有显示 你发布。 - - Nicholas Paldino [.NET / C#MVP] - mv*@spam.guard.caspershouse " Vlad" <一个********* @ gmail>。在消息中写道 news:11 ********************** @ o13g2000cwo.googlegr oups ... Vlad, Well, I changed the _address field and the test method to be public, and then wrote the value of _address out to the console after I ran test. The value was the same. There must be something else changing it which is not shown in the code that you posted. -- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse "Vlad" <a.*********@gmail> wrote in message news:11**********************@o13g2000cwo.googlegr oups... 在下面的代码中: 不安全的类X { byte * _address; void test() { _address =(byte *)144220152; } 为什么监视窗口显示_address变量的不同地址? In the following code: unsafe class X { byte* _address; void test() { _address=(byte*)144220152; } } Why the watch windows shows a differtent address for _address variable ?

更多推荐

将地址指向指针

本文发布于:2023-07-29 00:44:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1235663.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:指针   地址

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!