Pointer: is also the variable that holds the address of the variable.
A pointer is an indirect variable, and a variable is an indirect memory.
Address bus in virtual memory determines the amount of memory you can access.
32-bit CPU maximum virtual memory: 2^32 = 4 GB So 32-bit XP uses 8G of memory and is useless.
The pointer holds a variable address that is a set of data represented by a hexadecimal data, rather than the actual in-memory content.
int *pmyint; Pmyint represents the address that is stored, which is a memory address. An int indicates that the data type stored in this address represents a pointer variable
Pointer variable = pointer. The description is convenient. The value of the address stored in the pointer variable, 650) this.width=650; "title=" screenshot 2015-07-25 morning 10.17.38.png "alt=" screenshot 2015-07-25 morning 10.17.38.png "src=" /e/u261/themes/default/images/spacer.gif "class=" ynote-attachment "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;"/>
*mypointer = 27; Indicates that the contents of the Mypointer address are 27.
CP oldname newname path file copy. %s output string. The value of the __func__ can be received.
When a function is called, a value is passed.
Variable scope
File scope variables are also known as global variables.
%p Print the variable address. Assign a value with the & variable name. pintf ("%p", &numdots);
extern int numdots;//declares that numdots is an external variable, which is a global variable that has been declared in other parts.
A file scope is useful in this file, and declaring the variable with the static keyword is used in this file. (static int doger = 3;) A variable that is defined outside of all functions has a file scope.
function scope, which applies only to the label used by the Goto statement , which means that a goto tag in a particular function is visible to code anywhere in the function, regardless of the code block in which it appears.
When using global variables, compilation requires two files to be compiled together Gcc-o first.c SECOND.C
There are two storage periods for C variables: Static storage period, dynamic storage period. If a variable has a static storage period, it persists during program execution, and a variable with a file scope has a static storage period.
Variables with code blocks typically have an automatic storage period.
Function prototype scope void change (int *); Applies to variable names used in function prototypes. From the variable to the definition until the end of the prototype.
The stack area (the system to manage memory) is dynamically changing. There is a free space below the stack area. Stack is FIFO. High address to low address extension.
High address (command line or environment variable)
The heap area (memory requires the programmer to be responsible for managing, requesting, and releasing) is used by low addresses to high address extensions.
The uninitialized region of the BSS region global variable.
Init data initializes the range global variable to which the data area is initialized.
Code area directives are stored in the code area. The zone permission is read-only. Shares. Protected area.
Memory divided into seven regions
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/70/31/wKiom1Wzl8CAXTN8AAG5GpikpaA003.jpg "title=" Memory map. png "alt=" wkiom1wzl8caxtn8aag5gpikpaa003.jpg "/>650" this.width=650; "title=" screenshot 2015-07-25 pm 4.28.58.png " alt= "Screen shot 2015-07-25 pm 4.28.58.png" src= "/e/u261/themes/default/images/spacer.gif" class= "Ynote-attachment" style= " Background:url ("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd; "/>650) this.width=650; "title=" 694557.png "alt=" 694557.png "src="/e/u261/themes/default/images/spacer.gif "class=" Ynote-attachment "style=" Background:url ("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px Solid #ddd; "/>
Assigning a variable while declaring it is called initialization. int myint=100; The constant area that is stored in the data area.
Literal constants are stored in the data area (init data area)
Variables declared inside the function are stored in the stack area.
Global variables and function returns are two other mechanisms for sharing data in different functions. Before a global variable is used to add a G. For example: int gmyint.
Return is returned to the place where the function was called.
Variable Storage Address Map
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/70/31/wKiom1WzmACBn9DNAAN9PMtNmJ4845.jpg "title=" The variable holds the address graph. png "alt=" wkiom1wzmacbn9dnaan9pmtnmj4845.jpg "/>
Headache-giving pointers and memory in C language