Since I wrote some questions about array pointers yesterday, let's write some topics about array pointers today.
Array pointer: A pointer to an array, that is, an array pointer, which is essentially a pointer
For example: Int (*a) [3]; is an array pointer, using the following
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main
{
int A[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
int (*B) [3];
int i = 0,j = 0;
b = A;
for (i = 0; i < 3; i++)
{
for (j = 0;j < 3; j + +)
{
printf ("%d", b[i][j]);
}
}
}
Then we can find that we can print out all the numbers 1 to 9, which means that the function pointers and the two-dimensional arrays are used the same way; about pointer arrays and arrays of pointers how to say, the general usage is this, about their equivalence relationship I will show you:
Pointer parameters equivalent to array parameters
One-dimensional array char a[30] = = Pointer char *a;
Pointer array char *a[30] = = pointer of char **a;
The pointer char (*A) of the array of two-dimensional array char a[10][30] = = [30];
This is probably the case;
Relationship between two-dimensional arrays and array pointers