C language pointer "that thing"

This article is mainly about us in the C language, we have a sense of fear of knowledge: pointer, so the usual development is also less than with even the basic need, it seems as if a use would go wrong, in fact, not so terrible, the pointer is the essence of C language, but also the difficulty of the C language, C language pointer to break, make your C language level by leaps and bounds, the following words only explained pointer knowledge, let's fun and easy to understand pointers.

       We all know that the most important feature c language is the ability to directly access memory, which is our c pointer. Pointer: its essence is the tool used to access the memory , it stores the data in memory address instead of data values themselves, then we need to know what our memory, we know what pointer to access memory What are some of the things? Simply put, the variables we put things in memory is what we usually used in programming, this variable which is the content of our own programmers meaning prescribed!

       So when we need to access, modify variable content, you may not need to be obtained through our variable name, we only need to know the location of the variable in memory (possibly a relative position or absolute position) can, through a pointer variable access to all data. Of course, you can turn to think about, except we use a pointer, what advanced techniques can get all the data in memory! So pointer is the essence!

       Of course, there are some students might ask, access all memory pointer by what use is it? The saying is: The most important is the relationship between the data and the data, then we can design by pointer memory access algorithm, which design is more unified and efficient application algorithms!

Definitions of common pointer variable
Definitions Meaning
int *p; p can point type int data point may be similar int arr [n] array.
int **p; p is two pointer of type int * data.
int *p[n]; p is an array of pointers. [] * Higher priority, so it should be understood that as int * (p [n]);
int (*p)[n]; p is a two-dimensional array of pointers.
int *p(); p is a function which returns a value of type int *.
int (*p)(); p is a function pointer prototype int func () function.
Published 26 original articles · won praise 40 · views 60000 +

Guess you like

Origin blog.csdn.net/qq_21990661/article/details/104720873