Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Integer range in c language
Integer range in c language
Integers in c language are generally divided into char type and int type, and different types have different values. In a 32-bit system:

Character value range:-128~ 127

Value range of unsigned characters: 0~255

Int range:-2147483648 ~ 2147483647.

Unsigned integer value range: 0~4294967295

In C language, the maximum and minimum values of integer types can be used directly through the header file limits.h in the C standard library. Examples are as follows:

# Contains? & ltstdio.h & gt

# Contains? & lt restrictions & gt

int? Master ()

{

Printf("char range: %d~%d\n ",CHAR_MIN,? CHAR_MAX? );

Printf ("unsigned? Character value range: %u~%u\n ",0,? UCHAR _ MAX);

Printf("int value range: %d~%d\n ",? INT_MIN,? INT _ MAX);

Printf ("unsigned? Int value range: %u~%u\n ",? 0,? UINT _ MAX);

Return? 0;

}