What are the basic data types of C language? Integer type, real number type and character type
What is the basic data type of C language? I want to know the definition of basic data types! Thank you ~ ~ ~ Data type is the definition of describing data in programming language, because the machine can't recognize data, and the mutual operation between different data is performed differently in the machine. This requires the user to define the characteristics of the data before doing other operations. The characteristic here is the data type.
Common data types are:
Int integer double precision floating point floating point floating point floating point
Character long integer ......
Is unsigned the basic data type of C language? Unsigned is not a basic data type, but a modifier of data type, which corresponds to signed (generally omitted).
Unsigned a; Signed int a;; It is the same. Int is omitted here.
int a; Signed int a;; It is the same.
In learning, we only need to know the meaning of keywords, and whether they belong to "basic data type" is meaningless to practical application. This is just a statement.
What are the three basic data types of C language? The three basic data types in C language are integer, real and character.
1 integer, including short, int, long, long long, etc. , which is used to represent an integer, is signed by default, and can be expressed as unsigned with the unsigned keyword.
2 Real numbers, that is, floating points, including float and double, are used to represent real numbers. Compared with integer type, this type can represent numerical values with decimal parts. It should be noted that the real type is an approximate representation in computer language, not an accurate value, and the deviation of the true value may occur after many calculations.
3-character type, that is, char type, is used to represent various characters and corresponds to ascii code table one by one. Except that it can be used to represent various characters, other rules of char type are the same as those of integer, and char can be considered as a special integer.
The basic data type of C language %c takes the value of 8-bit char type, and the binary after c+256 is 10000000+XXXXX, and the 8-bit is 000XXXXX, so it is still XXXXX, which is all A~
() is not the basic data type of C++ language d) Enumeration type,
Character type is char, integer type is int, logical types are 1 and 0, 1 is true, 0 is false, enumeration type is not data type, but construction type!
What are the three basic data types of C language? The three basic data types of C language are integer, real and character.
1, integer Including short, int, long, etc. , which is used to represent an integer, is signed by default, and can be expressed as unsigned with the unsigned keyword. 2. Real type, that is, floating-point type. Including floating, double precision, etc. A used to represent a real number, as opposed to an integer.
3. Character type, namely char type. Used to represent various characters, corresponding to ascii code table one by one.
Char character, accounting for 1 byte.
Short integer, accounting for 2 bytes.
Int integer, accounting for 4 bytes.
Long long, accounting for 4 bytes.
Float single-precision floating-point type, accounting for 4 bytes.
Double double-precision floating-point type, accounting for 8 bytes.
C language is a general computer programming language, which is widely used. The design goal of C language is to provide a programming language that can compile and process low-level memory in a simple way, generate a small amount of machine code and run without any support of running environment.
Although C language provides many low-level processing functions, it still maintains good cross-platform characteristics. C language programs written in standard specifications can be compiled on many computer platforms, even including some embedded processors (single chip microcomputer or MCU) and supercomputers.
The three basic data types of C language are integer, real and character.
1 integer, including short, int, long and so on. , which is used to represent an integer, is signed by default, and can be represented as unsigned by unsigned keyword.
2 real type, namely floating type, including floating and double type. A used to represent a real number. Compared with integer type, this type can represent numerical values with decimal parts. It should be noted that the real type is an approximate representation in computer language, not an accurate value, and the deviation of the true value may occur after many calculations.
3-character type, that is, char type, is used to represent various characters and corresponds to ascii code table one by one. Except that it can be used to represent various characters, other rules of char type are the same as those of integer, and char can be considered as a special integer.
The basic data types of C language are divided into six basic data types.
short、int、long、char、float、double