Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

Any help will be appreciated. Thank you,

Jec

like image 650
jecjackal Avatar asked Sep 17 '13 17:09

jecjackal


People also ask

How do I find the memory address in Visual Studio?

Under Debug > Windows > Memory, select Memory 1, Memory 2, Memory 3, or Memory 4. (Some editions of Visual Studio offer only one Memory window.)

How do I see allocated memory in Visual Studio?

To bring up the window again, click Debug > Windows > Show Diagnostic Tools. Choose Memory Usage with the Select Tools setting on the toolbar. Click Debug / Start Debugging (or Start on the toolbar, or F5). When the app finishes loading, the Summary view of the Diagnostics Tools appears.

How do I view a watch window in Visual Studio?

Observe a single variable or expression with QuickWatch Start debugging. Execution pauses at the breakpoint. Select the variable a in the code. Select Debug > QuickWatch, press Shift+F9, or right-click and select QuickWatch.


1 Answers

Put a debug point, Start your application, when that debug point is hit, Go to Debug -> Windows -> Memory enter image description here

There in Address textbox type, the name of variable, and you will be able to see the address.

Short-cut key in Visual Studio 2012 appears as CTRL+ALT+M, 1

like image 67
Habib Avatar answered Oct 13 '22 01:10

Habib