Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - In C language, what does it mean to define an integer variable preceded by *, such as int a[]={2, 4, 6, 8, 10}, x, * p;; What's the p+ here? thank
In C language, what does it mean to define an integer variable preceded by *, such as int a[]={2, 4, 6, 8, 10}, x, * p;; What's the p+ here? thank
int * p; //Define a pointer variable to an address of type int.

int a = 5; //Define an integer variable A and assign a value of 5 to the variable A..

p = & ampa; //Point the pointing variable p to the address a (&; Is an address operator)

printf("%d ",* p); //Print what the pointer p points to. Please note that the meaning of "*" here is different from the meaning of "*" used in the definition in the first line. The "*" here refers to what the pointer variable p points to, while the "*" used in the first line definition means that the variable p is a pointer type variable.