Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - In C language, * (&; A)==a,& (* p) = = the difference between p.
In C language, * (&; A)==a,& (* p) = = the difference between p.
A and p are variables. A and *p are expressions, and 1 and 0x 1000 are constants.

A and *p are integer left values, p and&p;; A stands for pointer left value, 1 and 0x 1000 stand for integer and pointer right value. (If the concept of left and right values is unclear, Google it. )

In memory, A and P have storage space, A stores 1, P stores 0x 1000, *p and&; A has no spaces, and their operation results are stored in the register. 1 and 0x 1000 also have spaces, which are stored in the constant section of the program.

*p According to Stanley Lippman's C++ Primer, p is a pointer variable, * is a dereference operator, and *p is an expression, which means "dereference pointer variable p", which is different from the expression &; The meaning of "take the address of plastic variable A" is just the opposite operation.