Cast Operator

suggest change

Performs an explicit conversion into the given type from the value resulting from evaluating the given expression.

int x = 3;
int y = 4;
printf("%f\n", (double)x / y); /* Outputs "0.750000". */

Here the value of x is converted to double, the usual arithmetic conversions convert y to double as well, and the double result is passed to printf.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents