The
Cast Operator
The cast operator is an operator
which forces a particular type mould or type cast onto a value, hence the name.
For instance a character type variable could be forced to fit into an integer
type box by the statement:
char ch;
int i;
i = (int) ch;
This operator was introduced
earlier, See Variables.
It will always produce some value, whatever the conversion: however remotely
improbable it might seem. For instance it is quite possible to convert a
character into a floating point number: the result will be a floating point
representation of its ASCII code!
0 comments:
Post a Comment