Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language: if int *p, k; Then *p=k, p = &;; What's the difference between k?
C language: if int *p, k; Then *p=k, p = &;; What's the difference between k?
1、int *p、k;

* p = k; //This is wrong! This sentence must be preceded by a premise, which can be like this.

int *p,k,y;

p = & ampy;

* p = k; //At this time, it means that the value of variable K is assigned to the space pointed by pointer variable P, which is equivalent to y = k;;

2、int *p,k;

p = & ampk; //is equivalent to assigning the address of the variable k to the pointer variable p.