Words not much said, direct code, the following is a multi-level pointer, through the pointer variable to modify the value of the variable
#include <stdio.h> #include <stdlib.h>
void Secondpoint (int **a, float ***f, double ****d, char *****c) {
**a = 100;
f = 9.2f;
D = 3.14;
c = ' g ';
}
int main () {
int a0 = 10;
int *a = &a0;
float F0 = 0.1f;
float *F1 = &f0;
float **F2 = &f1;
Double D0;
Double *d1 = &d0;
Double **d2 = &d1;
Double ***d3 = &d2;
char C0;
Char *c1 = &c0;
Char **c2 = &c1;
Char ***c3 = &c2;
Char ****c4 = &c3;
Secondpoint (&A,&F2,&D3,&C4);
printf ("a=%d,f=%.1f,d=%.2lf,c=%c\n", a0,f0,d0,c0);
System ("pause");
return 0;
}
It is important to note that the pointer variable is a pointer to a variable that cannot be stored, such as the following:
int *p = 10;
This type of writing is illegal in C because the pointer variable p is a pointer to a stored variable and cannot store a constant value