Home  >  Article  >  Three basic types in C language

Three basic types in C language

尚
Original
2019-10-23 14:35:5317328browse

Three basic types in C language

The three basic data types of C language are integer, real and character.

1. Integer types, including short, int, long, etc., are used to represent an integer. The default is signed type. With the unsigned keyword, it can be expressed as unsigned type.

2. Real type, that is, floating point type, including float, double, etc., is used to represent real numbers. Compared with integer type, this type can represent values ​​with decimal parts. It should be noted that the real value in computer language is an approximate value, not an exact value, and deviations from the true value may occur after multiple calculations.

3. Character type, that is, char type, is used to represent various characters and corresponds to the ascii code table one-to-one. In addition to being able to represent various types of characters, the other rules of the char type are the same as those of the integer type. It can be considered that char is a special integer type.

The above is the detailed content of Three basic types 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