You need to assign a value to a pointer after you define the pointer before you can use *p to assign or assign a value, which is a fundamental problem, without understanding, causing a problem.
A null pointer, also called a dangling pointer, is a pointer that uses an uninitialized one.
When a pointer variable is not initialized, its value is not no, but an incorrect
Fixed value, its direction is also indeterminate, may damage the system normal
Working state, with disastrous consequences.
Cases:
M Ain ()
{int a = ten, *p A;
*p A = A:
*pa +=5;
Prin TF ("a=%d", p a);
)
The program in this example is intended to use the pointer to increase the value of the variable a
Add 5, but because the pointer pa is not initialized, it points to an in-memory
The unknown position, that is, the pointer pa itself is indeterminate. So the data
cannot be calculated correctly. Before using the pointer, point it to a
Valid address, will * PA=A; change to pa=& A;
The function that should be.
A small error in the pointer in the C language