02.C language data types

First, the basic type

C language basic data types include character, integer, floating point.

1, character (char)

Description of a single character (one byte), comprising a half-angle single quotes together, such as 'a', 'A', '1', '$', etc., can be entered in English keyboard and symbols are half-width characters.

'A'   'B'   'C' ...... 'Z'
'a'   'b'   'c' ...... 'z'
'0'   '1'   '2' ...... '9'
'~'   '!'   '@' ...... '+'

Chinese characters and punctuation two bytes (GBK coding), can not be considered a character, the following is illegal.

'好'
'。'
','
'¥'

2, integer (int)

Description Integer, Integer is accurately represented on the computer, such as 123,500,0, -10 and the like.

123
500
0
-10

3, float (float)

Description real numbers with decimal places, such as 10.0,123.55,3459.98, -50.3, real number on the computer is generally approximated.

10.0
123.55
345.98
-50.3

Second, the string

Description plurality of characters, comprising a half-angle double quotes up, may be English, numbers, Chinese, punctuation, full-width half-angle can be.

"a"
""
"西施"
"我心匪石,不可转也。我心匪席,不可卷也。威仪棣棣,不可选也。"
"我有100块钱。"
"1998"

Third, the type of construction

Constructed by the construction method of a certain type of basic types, including arrays and structures, later sections describe them in detail.

Fourth, the pointer type

Pointer variables and constants can be stored in the memory address, the main argument for the transfer function is extremely important, if there is no pointer, C programmers will be very uncomfortable, in later chapters describe it in detail.

V. Other data types

C language as well as other data types, such as complex types (_Complex), imaginary type (_Imaginary), boolean (_bool), these data types of scenarios seldom, I not introduced.

Sixth, Copyright

C Language Technology Network original article, reproduced please indicate the source link to the article, the author and original.
Source: C Language Technology Network (www.freecplus.net)
Author: Ethics code Agriculture

Published 29 original articles · won praise 2 · Views 694

Guess you like

Origin blog.csdn.net/m0_45133894/article/details/104625902