VS2017 view variable address and the address corresponding to the content

To write a simple piece of C code

#include <stdio.h>
int main() {
	int a;
	a = 1;
	a = 2;
	int arr[100];
	arr[0] = 4;
	return 0;
}

1. Press F5 to debug the debug VS2017 after running press F10, press course be set breakpoints.
When the program in debug mode, then click Debug -> Windows -> Memory -> Memory 1. Note: You must be in debug mode for the job.

 

Here Insert Picture Description

2. In the code window right mouse button in the pop-up list, select the Quick Watch
Here Insert Picture Description 

3. Click & After entering a recalculation, the value of a & recording, where the value 0x00cffd28
Here Insert Picture Description 

4. After the address bar memory monitor window below the screen input 0x00cffd28 press Enter
Here Insert Picture Description 

5. Press F11 to step through, found inside the memory content has changed, as to why it is 01 million, instead of 00,000,001, which is probably because of the large and small end.
Here Insert Picture Description 

Published 133 original articles · won praise 129 · views 330 000 +

Guess you like

Origin blog.csdn.net/wofreeo/article/details/103534194