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).
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
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!