ccaasstt -- Definition

The _c_a_s_t operation ``coerces'' a variable from one data type to another.

There  are two  reasons to  cast  a variable.   The first  is to  convert a
variable's data  into a form acceptable to a  given function.  For example,
the function hhyyppoott takes two ddoouubbllees.  If the variables lleegg_xx and lleegg_yy are
ffllooaatts, the rules  of C require that they be  cast automatically to ddoouubbllee.
If the compiler  did not do not do this,  hhyyppoott would grab a ddoouubbllee's worth
of  memory: the  four bytes  of  your ffllooaatt,  plus four  bytes of  whatever
happens to  be sitting on  the stack.  The  leads to results  that are less
than totally accurate.

The other reason to cast a variable is when you cast one type of pointer to
another.  For example,

    char *foo;
    int *bar;
    bar = (int *)foo;

Although ffoooo  and bbaarr are  of the same  length, you would cast  ffoooo in this
instance to stop the C compiler from complaining about a type mismatch.

_S_e_e _A_l_s_o
ddaattaa ffoorrmmaattss, ddaattaa ttyyppeess, PPrrooggrraammmmiinngg CCOOHHEERREENNTT
