+ 3
Can anyone explain the implicit type conversion?
concepts, format etc,
2 Antworten
+ 15
When an expression contains operands of different built-in types, and no explicit casts are present, the compiler uses built-in standard conversions to convert one of the operands so that the types match. (implicitly)
There are two kinds of implicit conversion:
1. Widening --> int a = 50; double b = a;
2. Narrowing --> double c = 1.234567891234; float d = c;
double foo = a / c; // a promoted (implicitly) to double since c is a double
+ 2
The definition of implicit type conversion is that one data type is converted to another data type automatically by the compiler without any cause by the programmer.