Some insight into the concept of the C language pointer

A pointer:
First talk about the concept of pointers: Take int p, is to define a pointer, p points to a section of memory space, address p value of this memory space, this space is kept inside an int space, that is, from the start will be stored on the location of the address four bytes of memory int data type, and the value of p is always the address and the address does not change, use p to access this memory space to store the above value. (own understanding, may not be true, beginners hope to understand!)

We normally use int *, char *, etc. are considered relatively simple use of pointers, it is to use a pointer to point to a certain type of data.

Two pointers:
in essence above and a pointer is not much difference, still essentially a pointer, just like nature or one-dimensional array of two-dimensional arrays, each the equivalent of two pointers point to a pointer for example: int p: p * p is the address, * p is p address.

And an array of pointers:
pointers and arrays does not matter, just the same usage in many situations, such as: pointers and arrays can be used * to use, can also remove the standard to use.
int * p: p This is a memory address
int a []: a is the first element of the array address

Array of pointers: still essentially an array, but the array is stored inside pointer variable, for example:
int the p-[]: the p-name is an array, the array is stored inside int type pointer

Guess you like

Origin blog.csdn.net/qq_44783220/article/details/90677655