C examples for Data Type:Type Cast
An explicit cast is done by adding the target data type in parentheses in front of the expression.
#include <stdio.h> int main(void) { int i = (int)10.5; /* double demoted to int */ char c = (char)i; /* int demoted to char */ /*from w w w . ja va 2s .c o m*/ printf("%c",c); }