Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - The difference between int and char
The difference between int and char
1, different character types

Int is integer data, such as: int a, then the value of a can only be an integer; For example, a=3.

Char is a character type, such as: char a, then the value of a can only be a character type; For example, a='a'.

Float is floating-point data, such as: float a, then the value of a can only be floating-point data; For example, a = 3.50& lt is the real number in our mathematics: it must be written in decimal >; .

2. Different memory sizes

The memory size of int is 4 bytes.

The memory size of char is 1 byte.

The size of floating-point memory is 4 bytes.

3, indicating the data range.

Int: The range of numbers is -(3 1 of 2-1) to (3 1 of 2-1), and the number is-2147 483 647 ~ 2147 47.

char:- 128- 127 .

Float: integer limit is 3.4 * 10 38, and so is negative number.

Baidu Encyclopedia-Structure Type