C language and pointer Learning
Encourage yourself to learn and use it!
--> Variables are not necessarily stored in the memory in the declared order.
--> & Operator: Get the variable address (pointer to the variable)
* Operators can obtain address variables.
Int j = 10;
Int * p = & j; // pointer p points to jint k = * j; // gets the variable pointed to by pointer p
--> Statement
Int * p;
Int * p; // equivalent
Int * p, p1; // two pointer variables cannot be declared. The second variable is int type.
--> Add N to the pointer, and forward the pointer to "the Data Type length pointed to by the current pointer xN"
--> Array subscript starts from 0
Int array [10];
Array [0]-> array [9] // 10 elements
--> Array and pointer
Int array [];
Int * p;
P = array [0];
P = array; // point the pointer p to the address of the starting element of the array.
* (P + I)
P [I]
/* Array name [array element]
Array name-> address of the starting element of the array, which can be understood as a pointer */
Array [2];
* (Array + 2); // they are equivalent