Home  >  Article  >  Backend Development  >  What are the basic data types allowed in C language?

What are the basic data types allowed in C language?

青灯夜游
青灯夜游Original
2020-08-17 11:18:508957browse

The basic data types allowed in the C language include: integers (short, int, long), real types (single-precision float, double-precision double), and character types (char).

What are the basic data types allowed in C language?

Recommended: "C Video Tutorial"

The C language has 3 basic data types:

  • Integer type represents an integer, usually including "short", "int", "long", etc.

  • Real type, "real type" is floating point data, including "float", "double", etc.

    "Real type" is usually used to represent real numbers, and can also be used to represent decimals that cannot be represented by integers.

  • Character type, "Character type" is "char" type data, which is usually used to represent various characters.

    "Character type" corresponds to "ASCII" code one-to-one.

Extended information:

Data types included in C language

What are the basic data types allowed in C language?

Among them, the six keywords short, int, long, char, float, and double represent the six basic data types in C language.

On different systems, the length of bytes occupied by these types is different:

On 32-bit systems

  • short occupies The memory size is 2 bytes; the memory size occupied by

  • int is 4 bytes; the memory size occupied by

  • long is 4 bytes ;

  • The memory size occupied by float is 4 bytes;

  • The memory size occupied by double is 8 bytes;

  • The memory size occupied by char is 1 byte.

You can use sizeof to test it.

For more related programming knowledge, please visit: Programming Learning Website! !

The above is the detailed content of What are the basic data types allowed in C language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn