What are the basic data types allowed in C language?

青灯夜游
Release: 2020-08-17 11:19:32
Original
8880 people have browsed it

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 typerepresents 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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!