Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Shaping pointer length
Shaping pointer length
In the sizeof command,

First, if the parameter is a pointer variable (no matter what kind of pointer), the result is 4.

2. If the parameter is an array, the size of the space occupied by the array is returned, namely: int a [n]; sizeof(a)= n * sizeof(int);

3. If the parameter is a variable type, the space occupied by this type will be returned. Sizeof (char) =1sizeof (int) = 4 sizeof (double) = 8 The space occupied by specific variable types is related to the machine type, for example, a 32-bit machine takes up 4 bytes and a 64-bit machine takes up 8 bytes.