Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What are the data types of integers in C language?
What are the data types of integers in C language?
In C language, there are two simple built-in types: integer and void (arrays and pointers are both compound types).

Integer has eight data types: unsigned character,? Signed character, short integer, unsigned short integer,? Integer, unsigned integer, long integer, unsigned long integer.

In order to use these data types correctly and reasonably, we need to understand their meaning and know the value range of each integer type. Here I simply divide integers into the following types:

l? Char):char may be the abbreviation of unsigned char or signed char, depending on the compiler. It is usually used to store characters. Expressed as 1 byte.

l? Short: the type specifier is short int or short. There are 2 bytes in memory.

l? Basic type (int): A common type that does not occupy small memory or large memory. It is one of the most widely used integer types, occupying at least 2 bytes of memory, usually 4 bytes.

l? Long: The type specifier is long int or Long, which occupies at least 4 bytes of memory.

l? Unsigned: The first bit is not a sign bit, so it cannot represent a negative number. The first four types have corresponding unsigned types.

The following table lists the number of bytes in the memory allocated by various integer data in C language and the expression range of this number.

There are many introductions of logarithmic value types in the tutorial "Data Types", so you can have a look.