Data Type
The C language provides a wide range of data types, which can be divided into two categories: Basic Types and constructed data types.
The primary feature of basic data types is that they cannot be further decomposed into other types. That is to say, the basic data type is self-explanatory.
The constructed data type is defined according to one or more defined data types. That is to say, the value of a construction type can be divided into several "members" or "elements ". Each "member" is a basic data type or a constructor type.
In C, there are several types of constructor:
Array type, structure type, and union type.
The basic types are as follows:
1. Integer
An integer is used to store integers. Its value can be a decimal, octal, or hexadecimal number. Integer Variables are defined by the keyword int.
In addition, the integer type can be used with short, long, signed, unsigned, and other modifiers to form a new type. For example, a signed int indicates a short integer, A longint indicates a long integer, A singnedint indicates a signed integer, and an unsignedint indicates an unsignedint.
2. Floating Point Type
Float Type is also known as solid type single precision type or real type. It is often used to represent decimal places or numeric values beyond the Integer Range.
Float variables are defined by the keyword float.
3. Double Precision
The double-precision type is often used for scientific calculation of large numbers or demanding accuracy.
Double variables are defined by the keyword double.
4. Balanced type
Delimiter is the data type used to represent ASCII characters.
Character variables are defined by the keyword char.
5. valueless
The valueless type is defined by the keyword void. The valueless type is a special type. It is often used in function definition to indicate that the function has no return value.
6. User-defined types
In addition to the data types provided by the system, the C language also allows you to customize data types. The definition format is as follows:
Typedef type name new type name;
From 10-3G-He Jinchao