C# Visual Studio,在监视窗口中查看变量的内存地址
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18856487/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio, See variable's memory address in watch window
提问by jecHymanal
One particular feature I'm used to having in a watch window is a variable's memory address. IIRC Visual Studio does this for C++ (I know QtCreator/Eclipse do). Is there a simple way I can do this in Visual Studio for a C# program?
我习惯在监视窗口中使用的一项特殊功能是变量的内存地址。IIRC Visual Studio 为 C++ 执行此操作(我知道 QtCreator/Eclipse 可以)。有没有一种简单的方法可以在 Visual Studio 中为 C# 程序执行此操作?
Any help will be appreciated. Thank you,
任何帮助将不胜感激。谢谢,
Jec
Hyman
采纳答案by Habib
Put a debug point, Start your application, when that debug point is hit, Go to Debug -> Windows -> Memory
放置一个调试点,启动您的应用程序,当该调试点被击中时,转到调试 -> Windows -> 内存
There in Address
textbox type, the name of variable, and you will be able to see the address.
有在Address
文本类型,变量的名字,你将能够看到的地址。
Short-cut key in Visual Studio 2012 appears as Cntl + Alt + M, 1
Visual Studio 2012 中的快捷键显示为 Cntl + Alt + M, 1