Actions

EmSys

C - Explicit type conversion

From EdWiki

Explicit type conversion

  • Explicit type conversion is forced by the programmer, where automatic type conversion cannot be done by the compiler.
float f1, f2;
int i = 10;
f1 = f2 = 20.713489;
i = (int)(f1 + f2);
// The sum of f1 and f2 is explicitly converted to an int.