Describe implicit conversion briefly.



provide coercion.

In a mixed-type expression, data of one or more subtypes can be converted to a supertype as needed at runtime so that the program will run correctly. For example, the following is legal C language code:
double  d;
long    l;
int     i;

if (d > i)       d = i;
if (i > l)        l = i;
if (d == l)     d *= 2;

Although d, l and i belong to different data types, they will be automatically converted to equal data types each time a comparison or assignment is executed.
Next Post Previous Post
No Comment
Add Comment
comment url