The article directories
- Integer types
-
- 1. Basic introduction
- 2. Case Demonstration:
- 3. Types of integers
- 4. Details of the use of integers
Integer types
1. Basic introduction
- C’s integer types are used to store integer values, such as 12, 30, 3456, and so on
2. Case Demonstration:
int num = 10;
Copy the code
3. Types of integers
4. Details of the use of integers
- The size of each type of storage depends on the operating system, the system bits and the compiler. Currently, 64-bit systems are generally used
- In practice, C programs usually run on Linux/Unix operating systems. Level 2, Using Windows
- C language integer type, divided into signs
signed
And unsignedunsigned
Two. The default issigned
- In C programs, integers are often declared as
int
Type, unless insufficient to represent large numberslong long
bit
Bit: The smallest unit of storage in a computer.byte
Byte: basic unit of storage in a computer.
1byte = 8bit
- A simple example
short 3
和int 3
】
short 3
It’s in memory2
byte
int 3
It’s in memory4
A word