|
|
|
|
|
by shakna
340 days ago
|
|
It's not casting. (char*)21 != "21"
Casting is converting the container, the interpretation.What you're reaching for is type conversion. Some languages have "implicit conversion" when casting, but the word itself doesn't require it. |
|
A cast of insert a conversion that wouldn't take place:
or coerce a conversion that otherwise requires a diagnostic: Loosely speaking, casting is another name for coercion, which refers to making a conversion happen that might not otherwise.