Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What's the difference between int, char and float?
What's the difference between int, char and float?
The differences are as follows:

First, the difference between definitions.

1 and int are integers, which are used to define integer data.

2.char is a character type, which is used to define character type data.

3.float is a single-precision floating-point type, which can be accurate to six decimal places.

Second, the difference in size.

1, int memory size is 4bybe.

2.char memory size is 1bybe.

3. The memory size of the 3.float is 4bybe.

Extended data:

The classification of data types in C language is as follows:

Basic type, standard integer type, extended integer type, real floating-point type and complex floating-point type, enumeration type, void type, derived type, pointer type, array type, structure type, union type and function type.

Basic types and enumeration types are collectively referred to as arithmetic types (arithmetic? Type). Arithmetic type and pointer type, collectively referred to as scalar type (scalar? Type). Array types and structure types are collectively referred to as aggregate types (aggregate? Type). Trade union type (trade union? Type) is not considered an aggregate type, because only one member in a union can have a value at any time.

Function type (function? Type) describes the interface of the function. This means that the type not only specifies the type of the return value of the function, but also specifies the types of all parameters passed to the function when calling the function.

All other data types are used to describe objects. The description may or may not include information about the size of the object storage space. If so, this data type is called object type (object? Type); If not, it is an incomplete type (incomplete? Type).