I. One-dimensional arrays
1?? Clear the number of elements 2?? Cannot make variable 3?? Index value =04?? The array name is the first address of the array
Two. Pointers
① type of pointer
such as int *//integer pointer
char *//String pointer
FLOAT *//floating-point pointer
Note: Pointers can only point to a block address and cannot be given a constant value.
The role of ②*
1?? Define a pointer variable
2?? * (pointer variable) = = Gets the value of the variable pointed to by the pointer
Cases:
int a = 10;
int *p = &a;
*p = 10;
③int a = 10;
(*PA) + + = a++ = 11;
* (pa++) = * (the next memory space of a)//the Next memory space is the original memory address value + 4 bytes
Pointer variable takes 8 bytes in 64-bit system
Example: char a[10] = {}
Char *pa =a; represents the first address of array A
*pa the first address of an array a
Three. Const a//CONST defines a variable a as a constant
Constant pointer: const INT*PA = &a
PA=20//Error: (Cannot change the direction pointed to by the pointer)
Pa=&b//Correct: (Can change the direction of the pointer)
Pointer constants
int *const PA = &a;
*PA = 20/correct (can change the value pointed to by the pointer)
Pa=&b//error (Can not change pointer direction)
Constant pointer to constant
const INT * Const PA = &a;
*pa = 20;
PA =&a;
Cannot add const before a sort variable
12-10 about pointers