Type:
The variables defined in the main function can only be used in the main function, and cannot be used in other functions. In addition, the main function cannot use variables defined in other functions. Because the main function is also a function, it is in parallel with other functions. This is different from other languages and should be noted.
Strictly speaking, a pointer is an address and a constant. A pointer variable can be assigned different pointer values, which are variables. However, pointer variables are often referred to as pointers. To avoid confusion, we agree that "Pointer" refers to an address, a constant, and "pointer variable" refers to a variable with a value of an address. The purpose of defining pointers is to access memory units through pointers.
6.8
Summary of pointer data types and pointer operations
6.8.1
Summary of pointer Data Types
Definition
Int
I;
Define Integer Variables
Int
*
P;
P
Pointer variable pointing to integer data
Int
A [n];
Define integer array
, It has n
Elements
Int
*
P [N];
Define pointer array P
, Which consists of N
Pointer elements pointing to integer data
Int
(
*
P) [N];
P
To point to n
One-dimensional array of elements pointer variable
Int
F ();
F
Returns the integer function value.
Int
*
P ();
P
To bring back a pointer function that points to integer data
Int
(
*
P )();
P
Is a pointer to a function. This function returns an integer value.
Int
*
*
P;
P
Is a pointer variable pointing to an integer.
Variable