0 votes
in C Plus Plus by
What is typecasting in C?

1 Answer

0 votes
by

Typecasting is the process to convert a variable from one datatype to another.  If we want to store the large type value to an int type, then we will convert the data type into another data type explicitly.

Syntax: (data_type)expression;

For Example:

int x;
for(x=97; x<=122; x++)
{
   printf("%c", (char)x);   /*Explicit casting from int to char*/
}
...