1. The pointer is the same type as int char float, called the pointer type, denoted by *
2, pointer variable, pointer variable is what type of pointer, depends on what type of variable it points to
Integer pointer int *
String char *
Floating-point Pointer float *
3, note: The pointer can only point to a block address, cannot point to a constant value
For example int *p = 10; This is wrong.
& means take address, &a
so int *p = &a;
4. The pointer variable is 8 bytes in memory (64-bit operating system)
5. The function of the * number
1. Define a pointer variable
2.* (pointer variable) = = Gets the value of the variable pointed to by the pointer
For example int a = 10;
int *p = &a;
*p = 10;
(*p) + + =a++ = 11;
* (p++) = * (Next memory space of P) = the value in the next training space of P is treated as an address, and the corresponding value of this address is obtained.
6. Constant pointer
const int *PA = &a;
*pa = 20; Cannot change the value of the variable pointed to
PA = &b; can change pointer pointing
7. Pointer constant
int *const PA = &a;
*pa = 20; You can change the value of the variable pointed to by the pointer
PA = &b; cannot change pointer pointing
8. Constant pointer to constant
const int *const PA = &a;
*pa = 20;
PA = &b;
C Language Pointers