You can type cast any variable. Often the
is used as shown here when you're manipulating integer values. Another common case is when you're dealing with C language functions that require specific types of values. For example, the
function computes the sine of an angle (yawn), but it requires a
value. If you only passed it an integer variable
, you would have to uyse the following statement:
Code:
result=sin((double)x);
Here, the integer variable
is converted into a double for processing by the
function. The result is saved in the
varaible.[/PHP]
Thanks For The Answer :)
So, yes, you CAN do type casting in C.