2.8 TYPE CASTING (OR COERCION) IN C
C supports different data types like int, float, long, double, and so on. Each of these has a different
range of values because of their size and their signed/unsigned properties. In practice, an expression
can have an operation between two different data types (one can be an integer and another can be a
float or vice versa). To handle such situations, C provides certain rules of type conversion in these
cases.
Please understand that when a compiler encounters different types of operands in the
same expression, the smaller type variable is promoted to a larger type variable.
The order of
inbuilt data types is shown in
Table 2.12
.
Do'stlaringiz bilan baham: