The concept of pointers
The pointer is the address that can be used to find the specified data.
The pointer is the address, so when used, it is often simple to say that the pointer variable is a pointer
A pointer variable is a variable that stores an address
int *p1;//applies a variable that opens up a piece of memory in memory, storing the data
Opens up 8 bytes, and the pointer is 8 bytes under the Mac
Using pointers, you should actually say, using pointer variables
1> arithmetic operations
+1 move a few bytes?
See type: INT *, long *, char *
2> get the data represented by the address
The address is stored in the pointer, you can remove the data from the address
Addressing operator *&p1-P1
3> changing the data in the address
4> use as Function parameters (* * * * *)
If the pass is not a pointer variable, but a normal variable, is the value of the pass: inside the function and outside the function is two different variables, just the same data stored (like sending a file)
If a pointer variable is passed, that is, the address is passed, then the reference is passed: inside and outside the function can be considered the same variable (like sending a link)
Since the function parameters use pointers, it is possible to implement variables within the function that affect variables outside the function after they have been modified. Therefore, the function parameter is often set to a variable of pointer type
Implementing functions that return multiple data using parameters
scanf ("%d", &num);
Second-level pointers
A secondary pointer is a pointer to a first-level pointer (an n-level pointer is a pointer to a n-1-level pointer)
The essence of the pointer is the address, then the few pointers are just an address, the only difference is the result of addressing (*P)
1> the use of level two pointers in development is to return a first-level pointer data using a function or method
2> If you need to return data with a function parameter, if you return a generic data, pass a first-level pointer
3> if a first-level pointer is returned, then the parameter should be a level two pointer
4> If the return is an n-level pointer, then the parameter should be a n+1-level pointer
*P1 refers to the value of NUM, *P2 refers to the address of P1 memory, **P2 also refers to the value of num ...
C-language level pointers and level two pointers