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

  1. 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

  2. In practice, C programs usually run on Linux/Unix operating systems. Level 2, Using Windows
  3. C language integer type, divided into signssignedAnd unsignedunsignedTwo. The default issigned
  4. In C programs, integers are often declared asintType, unless insufficient to represent large numberslong long
  5. bitBit: The smallest unit of storage in a computer.byteByte: basic unit of storage in a computer.

    1byte = 8bit
  • A simple exampleshort 3int 3

    short 3It’s in memory2byte

    int 3It’s in memory4A word