Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Why are there negative numbers in the plastic numerical range in C language?
Why are there negative numbers in the plastic numerical range in C language?
Integers are divided into positive integers and negative integers 0.

If the highest sign bit is used, negative numbers will appear in C language.

Use sizeof (type) to determine the range.

Sizeof(int) equals 4, which means 4 * 8 = 32 bits 2 32 = 4294967296.

The range of int is-2147483647 ~ 2147483648.

Sizeof(int) is equal to 2, which means 2 * 8 = 16 bit 2 32 = 65536.

The range of int is -32768~32768.

The same type has different sizes in different compilers ~ ~