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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 13:26:07  来源:igfitidea点击:

Visual Studio, See variable's memory address in watch window

c#visual-studio-2012

提问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 enter image description here

放置一个调试点,启动您的应用程序,当该调试点被击中时,转到调试 -> Windows -> 内存 在此处输入图片说明

There in Addresstextbox 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