Home > Back-end >  How to connect a variable and a pointer?
How to connect a variable and a pointer?

Time:01-20

Ask, how to put the variable a link to the 1 point on the inside?
Can not be directly int a=1, because in that case, two 1 should be stored in different memory,

 
Int main () {
Int * point=NULL;
int a;
Point=malloc (3 * sizeof (int));
* point=1;
* (point + 1)=2;
* (point + 2)=3;
Printf (" % d, % d, % d \ n ", * point, * (point + 1), * (point) + 2);
return 0;
}
  • Related