C language among int, float, double, char four What's the difference?

The difference in the following areas:

First, the definitions:

1, int data type is an integer used to define the integer type.

2, float single-precision floating-point, accurate to six decimal places.

3, double double-precision floating-point type, can be accurate to the decimal point are twelve.

4, char for the character, data for defining the character type.

Second, the memory occupied:

1, int memory size is 4 byte.

2, float memory size is 4 byte.

3, double the memory size is 8 byte.

4, char memory size is 1 byte.

Elementary data type table is as follows:

Third, the data of the range indicated:

1, int: number range is - (the 31 th -12) to (-12 power of 31), number of -2147483647 2147483647 ~.

2, double: 1.111111111111111111111 range indicated as + 1023 * 2 ^ (1 1 52 later.) 1.7 * 10 ^ 308. Negative versa.

3, float: integer limit is 3.4 * 10 ^ 38, negative versa.

4、char:-128- 127。

Guess you like

Origin www.cnblogs.com/HGNET/p/11828304.html