Embedded C language 4.1 C language memory space - Pointer

Pointer: the address is the memory resources, synonymous with house number

  If your city is a RAM (memory), if you find a home that is through your home address (pointer) to find, but the memory of that type of content area of ​​your home furnishings (pointer content).

Pointer variable: the concept store pointer box

 

c compiler for this particular concept pointer, there are two questions?

1. Assign a box, the box for how much? ?

  In 32bit system, pointer four bytes

  In the system, 64bit, 8-byte pointer

 

A system can be seen, all pointers memory size is the same!

 

2. box is the address, what is the point to read the way memory is?

  We generally see  

   int * p // expression is a pointer p, she is int4 byte reads the address, which is a one-time reading four bytes.

  Similarly char * p // pointer p, a one-time reading bytes.

  The int * or char * data can be understood as the mold

 

  Pointer to memory, we must ensure legitimacy.

 

 

Guess you like

Origin www.cnblogs.com/ivyharding/p/11112831.html